XC16 v1.26 problem

This forum handles questions and discussions concerning Microchip’s 16-bit compilers, assemblers, linkers and related tools.

XC16 v1.26 problem

Postby jjones11 » Fri Mar 25, 2016 10:02 pm

I recently upgraded my tool chain to v1.26. I use MPLAB X v3.26, the ICD3 hockey-puck, and the dsPIC33FJ256MC710A PIC. All this stuff runs on my Win7-Pro 64-bit i7 PC.

I have analyzed and fixed an issue I was having with error 944 from the XC16 v1.26 Tool Chain. The issue is being experienced by others too:
http://www.microchip.com/forums/m917841.aspx

For me, the issue is only present when I build for Release Mode, but Release Mode is needed to build the flash-image. Debug Mode does not experience this issue because of the way the debug image is built.

In Release Mode, we use a Bootloader and a Runtime image. Our Bootloader holds the ivt (interrupt vector table) and the aivt (alternate interrupt vector table). The ivt is used by the Bootloader, and the aivt is pre-loaded with vectors to a jump-table located at a fixed location within the Runtime. The Runtime is "fixed" in PIC-memory via a custom .gld linker-file. Accordingly, the Runtime does NOT have an ivt or aivt, and its start-code enables usage of the aivt when it initializes - so an interrupt bounces from the Bootloader's aivt to the Runtime fixed jump-table, and into the Runtime's interrupt-handler.

Both the Bootloader and the Runtime get their .hex files built separately and correctly, but in Release Mode, the Compiler Tool Chain also combines both hex-files into the "unified" hex file to create the MPLAB X Program file that the ICD3 hockey-puck uses to flash the full Bootloader+Runtime into the PIC's memory.

It all works great and lasts a long time! That is, until we switched to the XC16 v1.26 Tool Chain.

The XC16 v1.26 Tool Chain seems to force inclusion of an ivt into our Runtime hex file, even though
    A) We don't use or reference it. This used to be all that was needed.
    B) I have added explicit "DISCARD" instructions in the Runtime's linker-script file to eliminate the .ivt Section, to no effect.
    C) I have even clicked the "Remove unused sections" in the Properties for the Release's xc16-ld, also to no effect.
Since the ivt is inappropriately included in the Runtime hex file (you can see it in the Runtime's Map file), it clashes with the ivt in the Bootloader when the Tool Chain tries to put together the "unified" hex file, and we get error 944.

I consider that to be a Tool Chain bug.

The fix is to drop back to the v1.25 Tool Chain, and everything works fine again.
Jeff
User avatar
jjones11
 
Posts: 2
Joined: Fri Mar 25, 2016 8:04 pm
Location: New Hampshire
PIC experience: Professional 2-5 years with MCHP products

Re: XC16 v1.26 problem

Postby Trevor » Sun Jun 05, 2016 10:32 am

There was a change in v1.26 noted in the release notes:

"Migrating to XC16 Version 1.26

Linker script files have removed vector table information. These are now controlled directly by the linker. Old-style linker scripts will still work as before, however, it is encouraged that custom linker scripts be updated to the new style.

These sections can be commented out using:

#if __XC16_VERSION < 1026
#endif


Around the section definition. Example of which can be seen in the currently shipped linker scripts.

Each filled vector slot is listed in the memory report individually instead of as one block labeled .ivt. This should make it easier to determine which slots have been filled in by application code and which slots have been filled by default."

This question answered by Microchippie at http://www.microchip.com/forums/FindPost/924836
Trevor
Verified identity
 
Posts: 13
Joined: Sun Jun 05, 2016 4:16 am
Location: The LAN Downunder
PIC experience: Experienced Hobbyist


Return to MPLAB XC16

Who is online

Users browsing this forum: No registered users and 1 guest

cron