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

Bootloader start application at 0x1000 fails

I'm using an example project of the secure serial bootloader (pca10056_uart_debug) and changed some configuration for my custom board. I added RTT debugging and changed uart pins as well as hwfc. As application I'm using a already existing project, that is set up with the SDK16 and SD140. I compiled bootloader (with new key) and application seperate and generated the bootloader settings of the application. After merging everything together (SD140+APP+BL+Settings), I cross checked the address of SD,APP and BL with the NRFConnect app. Everything seems ok.  Then I cleaned and flashed the chip with nrfjprog. The bootloader wants to start the app at 0x1000 but the application does not start at this point.

Do I have to configure or change something in the Application Project settings or configuration setup of the Applicatoin? What could be the problem of hanging after initiating the app start?

For settings generation I use this command:

nrfutil settings generate --family NRF52840 --application testapp.hex --application-version 1 --bootloader-version 0 --bl-settings-version 2 --app-boot-validation NO_VALIDATION --key-file ../my_private_key.key settings.hex

For merging:

mergehex -m $(SD) $(TESTAPP) $(OUTPUT)/secure_bootloader_uart_mbr_custom_board.hex -o .temp_output1.hex
mergehex -m .temp_output1.hex settings.hex -o $(OUTPUT)/merge_out_SD_APP_BL_SETTINGS.hex

For flashing:

nrfjprog -f nrf52 --program $(OUTPUT)/merge_out_SD_APP_BL_SETTINGS.hex --sectorerase

The memory layout after merging all:

Here the output of the RTT debugging after resetting the chip.

Parents Reply
  • Hello,

    Thanks. So the PC is inside the application's address range, and last byte of xPSR (0x3) shows that the program is in the hardfault interrupt context. Have you tried to see if the program runs ok if you program just the MBR+app without the bootloader?

    The only problem I can think of is if the app is not configured to start at address 0x1000 in flash or if it uses the the first 8 bytes of RAM which is reserved to the MBR (0x20000000 - 0x20000008)

Children
Related