SWD/JTAG restore issue - overlapping data

Hi all,

I am trying to use the restore binaries via SWD/JTAG to reflash at Tracker SOM. I have downloaded the Tracker hex files (Using SWD/JTAG | Reference | Particle). Using a j-link + nrfutil (on a Windows 11 PC), I can get device-info and core-info:

nrfutil device core-info
serial_number: 000269400NNN
codeAddress: 0
codePageSize: 4096
codeRamAddress: 8388608
codeRamPresent: true
codeSize: 1048576
dataRamAddress: 536870912
infoPageSize: 4096
pinResetPin: 0
qspiPresent: true
ramSize: 262144
uicrAddress: 268439552
xipAddress: 301989888
xipSize: 134217728

When I go to program the device, I keep getting an error regarding the hex file and overlapping data:

nrfutil device program --firmware tracker641.hex --options chip_erase_mode=ERASE_ALL,reset=RESET_SYSTEM,verify=VERIFY_READ
[00:00:00] ###### 100% [1/5 269400699] Failed, Failed to parse HEX file: Overlapping data in HEX file at address Address

Error: One or more program tasks failed:

  • 269400NNN: Failed to parse HEX file: Overlapping data in HEX file at address Address(0x000d4000) (Generic)

When I open the file in JFlash, it also says that areas overlap. It seems like I am missing something simple. Any suggestions?

Thanks!

It appears to be a bug for all nRF52 device restore hex files with Device OS >= 3.1.0 when using nrfutil, but really only affects Tracker. There's a 1K block of 0xff bytes starting at 0x0d4000 inserted in the hex file. This is because the user binary location was made larger in 3.1.0 by moving the start address 128K earlier in the flash. The 0xff bytes are there when the new user binary is < 128K so the old binary is overwritten because otherwise the device will boot using the old binary. When you drag and drop an image on the CMSIS/DAP volume it does not care about the overlapping sections. Also if the new binary is < 128K the sections will not overlap, which is why it doesn't show up for non-Tracker devices because Tinker is small.

In any case, because it affects so many hex files it has to be fixed with some care to make sure it won't break anything else so it's a non-trivial fix. It will be fixed, but it will take a little while to fix and test.

Thanks for the additional information; I successfully restored to 3.0.0, so I will go from there.

It was easier than I expected; the tracker.hex files are fixed now.

Fixed a bug in the Tracker Device Restore hex files for Device OS 3.1.0 to 6.4.1. The files contained an overlapping section at 0x0d4000 which caused some SWD/JTAG flashing tools to reject the hex files as invalid.