• AVR Freaks

Hot!Can no longer compile a SAMD21 project with XC32 after upgrade (v2.10 -> v2.40)

Author
onnimikki
Starting Member
  • Total Posts : 51
  • Reward points : 0
  • Joined: 2013/07/06 06:06:17
  • Location: 0
  • Status: offline
2020/08/04 14:32:03 (permalink)
0

Can no longer compile a SAMD21 project with XC32 after upgrade (v2.10 -> v2.40)

Hi,
 
I'm on MPLAB X 5.35 and updated from XC32 v2.10 to v2.40.  Previously, my SAMD21 project compiled but now it doesn't.
 
// main_SAMD21_Xplained_led_flash_once.c
#include <xc.h>

int main (void)
{
    // Anti-glitch: Pre-emptively turn off output to LED on Bit 30
    REG_PORT_OUTCLR1 = 1UL << 30;

    // Set PORTB bit 30 to be output
    REG_PORT_DIRSET1 = 1UL << 30;

    // Make the LED turn on via Bit 30.
    REG_PORT_OUTSET1 = 1UL << 30;
}

 
 I've found that, generally, including xc.h helps the compiler track down the header file with the specific chip definitions (like it does for ATMEGA, PIC16 and PIC32 parts), but that no longer seems to be the case.  (My PIC32MX project on XC32 v2.40 is still working fine and calling xc.h is still good)
 
I couldn't find anything in the XC32 documentation, but it could be that I was using the wrong keywords during the search.  Anybody have a tip on how to update included headers or preferences specifically for the SAMD parts?
 
thanks!
 
James
 
 
 
 
 
 
 
post edited by onnimikki - 2020/08/05 11:04:06
#1

1 Reply Related Threads

    jdeguire
    Super Member
    • Total Posts : 596
    • Reward points : 0
    • Joined: 2012/01/13 07:48:44
    • Location: United States
    • Status: offline
    Re: Can no longer compile a SAMD21 project with XC32 after upgrade (v2.10 -> v2.40) 2020/08/10 09:56:14 (permalink)
    0
    The release notes for v2.40 stated that the format of the SAM registers has changed. If you've used Harmony 3, the register definitions now looks like that.
    #2
    Jump to:
    © 2020 APG vNext Commercial Version 4.5