Hot!Migration to 2.10 compiler issue

Author
mautry
New Member
  • Total Posts : 16
  • Reward points : 0
  • Joined: 2018/05/16 06:59:19
  • Location: 0
  • Status: offline
2018/10/11 15:03:12 (permalink)
0

Migration to 2.10 compiler issue

I am migrating from compiler version 1.42 to 2.10 32bit for a PIC32MZ2048EFG100 project.  What compiled before is now failing on the linker with: 
 
In function `__reset_switch_isa':
libpic32/startup/crt0.S:(.reset+0x10): relocation truncated to fit: R_MIPS_26 against `_startup'
 
The startup code shows small enough to fit into the kseg0_boot_mem area:
  /* Application C startup module */
  kseg0_boot_mem              : ORIGIN = 0x9D000000, LENGTH = 0x1000
 
.startup ORIGIN(kseg0_boot_mem) :
  {
    KEEP(*(.reset.startup))
  } > kseg0_boot_mem
 
So I am kind of lost as to what the issue is with this new version.
#1

5 Replies Related Threads

    JasonK
    Moderator
    • Total Posts : 3381
    • Reward points : 0
    • Joined: 2003/11/14 09:49:40
    • Location: Microchip Technology in Arizona, USA
    • Status: offline
    Re: Migration to 2.10 compiler issue 2018/10/12 09:56:42 (permalink)
    0
    Hi, Does your project use a custom linker script or startup code?

    Jason Kajita
     Follow me on Twitter
    http://support.microchip.com for urgent questions
    #2
    SERGOSV
    New Member
    • Total Posts : 25
    • Reward points : 0
    • Joined: 2017/11/01 11:47:58
    • Location: 0
    • Status: offline
    Re: Migration to 2.10 compiler issue 2018/11/13 07:31:19 (permalink)
    0
    I had problems migration from 1.44 to 2.10 XC32. Version 2.10 does not make persistent variables, that I use as bootloader flags, as a coherent. 

    After setting the variable persistent, I have to do:
     
    (Fragment of bootloader code)
    unsigned int  __attribute__((persistent)) Var;
     
    void _on_reset (void)  {
       if(Var == 0xDEADBEEF)) {
           Var = 0;
           Enter_Application();
       }
    }
     
    void main( void) {
    ...........
    // FW update
    ............
     
    Var = 0xDEADBEEF;     
    _synci(&Var);           // Not needed in version XC32 1.44
    SYS_RESET_SoftwareReset();
    ..........
    }

    Otherwise, the persistent variable Var after reset is read as  "0".
     
    Maybe you have a similar problem ...
     
     
    post edited by SERGOSV - 2018/11/13 08:17:42
    #3
    Jim Nickerson
    User 452
    • Total Posts : 5458
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: Migration to 2.10 compiler issue 2018/11/13 07:47:50 (permalink)
    0
    Maybe in the bootloader and the application both this variable must be located at the same location and be declared persistent
    #4
    SERGOSV
    New Member
    • Total Posts : 25
    • Reward points : 0
    • Joined: 2017/11/01 11:47:58
    • Location: 0
    • Status: offline
    Re: Migration to 2.10 compiler issue 2018/11/13 08:04:44 (permalink)
    0
    The application does not use this variable. Only bootloader. If the FW has been updated, a persistent flag is set and a soft reset is made. After the reset, the state of the persistent flag is checked and if it has been set - jumps on the start address of the application.
    post edited by SERGOSV - 2018/11/13 08:44:34
    #5
    Jim Nickerson
    User 452
    • Total Posts : 5458
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: Migration to 2.10 compiler issue 2018/11/13 09:43:36 (permalink)
    0
    I note in the xc32 compiler users guide:

    For the 16- and 32-bit compilers, change any occurrence of the persistent attribute
    to __persistent, for example, from:
    int tblIdx __attribute__ ((persistent));
    to
    int __persistent tblIdx;

    #6
    Jump to:
    © 2018 APG vNext Commercial Version 4.5