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

Application won't run - erroneous flash address range

Hi,

I'm trying to flash the asset_tracker application to the nrf9160dk. I use Segger Embedded Studio for building the project for the nrf9160_pca10090ns board.
However, after flashing the application it won't run, the output from secure boot just keeps looping. 

Looking in the nRF connect programmer I see that the application flash address is starting at 0x00008000 and not at 0x00040000 as expected.

How can I change this?

  • Hi,

    the unexpected offset that you see is due to an update to NCS. Now projects built for non-secure nrf9160_pca10090ns target automatically includes Secure Partition Manager (SPM) and merges it with the application into a single .hex file. Some more details here on issues when used with Segger Embedded Studio:: https://devzone.nordicsemi.com/f/nordic-q-a/46780/nrf91-mqtt_simple/184528#184528. So, it's the hex file called merged.hex that needs to be programmed to the board, as it contains both SPM and application.

    If you want to, SPM can be disabled by setting CONFIG_SPM=n in your project's prj.conf file. Then the offset will be at 0x00040000 as you expect and you need to program secure_boot / SPM separately as before.

    Best regards,

    Jan Tore

  • Hi,

    I always selected Build->Build zephyr.elf, so the merged.hex file was never actually built..
    However, right-clicking the solution and building from there resulted in the aforementioned file.
    Everything works now, thanks! 

  • HOLY moly. That worked. I didn't expect that. Can you explain why that worked? Also, how do we debug now that it has been compiled that way, not from the Build menu?
    Noting that I received this error using at_client in version 1.0.0-rc2