Data Conflict at Address 0x######## Reported on Compilation (from Hexmate)

Bootloader projects often use the 'Loadables' feature of MPLAB® X IDE to develop bootloader and application projects together. This feature uses a utility called 'hexmate' to merge hex files.

This compilation error comes from the hexmate utility. It means that both of the two images used to make the combined hex image have conflicting data at mutual addresses.

Here are some of the possible causes of conflicts between bootloaders and application codes:

  1. Both contain different configuration bits in the source.
  2. Both contain source for the interrupt vector tables at the same location with a different source.
  3. Both have a dependence on a shared C startup code, resulting in a conflict at the reset vector (usually a bug in the app code).
  4. Data/code is absolutely placed at the same location in both projects.
  5. User ID data is placed in both projects.

To methodically isolate this problem, build both the bootloader and the application codes independently, and check their output memory map files. See what data is placed at the shared location, and then remove it in one of the projects. It is also possible to make the conflicting data the same in each project. (For example, the configuration bits have to match).

  • Be careful with byte or word addressing. Especially parts with word addressable memory, the data conflict message reports a byte address, so the message reported may need to be shifted to the right by one to match the address in the program code or in the map file.
  • 'Program the device with the default config words' may need to be unchecked in the project linker properties when attempting to only embed configuration bits in one project.

Lastly, if the specific address for the conflict is 0x1FC00480, this may be a known migration issue from XC32 v1.30's exception handling. The workaround is to add the following to the application linker script:

SECTIONS 
{ 
/DISCARD/ : { *(._debug_exception) } 
}
© 2023 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.