This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

mergehex with s310v1 and .bin generation

Hi, I need a .bin file of the whole flash memory for production programming. The procedure I have used until now (with s310v2) was the following:

  1. Upload .hex file of firmware with nrfgo;
  2. Upload .hex file of softdevice with nrfgo;
  3. Download the whole memory in a .hex file with nrfjprog;
  4. Convert the .hex file to a .bin with hex2bin.

Now it happens that s310v1 has readback protection enabled (s310v2 doesn't have that). So reading back the flash memory is not possible. I have tried the following solutions, with bad results:

  • Using mergehex for generating a unique .hex file to convert in .bin -> hex2bin complains about "overlapped records" (probably the UICR registers?), and the generated .bin file doesn't work as expected (infinite reboots)
  • Trying to tweak the softdevice .hex file by removing the definition in the 0x10001000 and 0x10000010 addresses (s310v2 leaves those addresses untouched) -> firmware doesn't work as expected, nrfgo complains about softdevice
  • Trying to download a .bin image with segger Jlink tool -> generates a .bin file which doesn't work when downloaded again to the flash memory

Is there another workaround for this problem?

Related