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

Can't get bootloader to log

Using SDK 12.2, I have compiled the secure bootloader successfully, tweaking the sdk_config and Makefile to use RTT for logging and turning on logging, and using the "_debug" linker script to place it at 0x75000. I used nrfutil to make a bootconfig.hex. I installed the bootloader, config, softdevice, and my app. Using JLinkExe, I can see all of them: SD at 0x0, my app at 0x1f000, bootloader at 0x75000 and config at 0x7f000.

When I boot the pca10040, LED3 comes on and stays on, but nothing is seen on the RTT console, I can't see the device advertising, and it appears hung. If I hold down button 4 while booting, LEDs 1 and 3 stay on, but still appears hung. Nothing ever shows on the RTT console.

It's hard to debug this if I can't see what's happening. Is there some reason the bootloader can't use RTT logging? Am I missing a step (for example, how does it know to look at 0x75000 instead of 0x78000)?

Parents
  • Update: though I never got -O0 to work, fixing the Makefile to add -fomit-frame_pointer to the compilation of nrf_bootloader_app_start.c seems to have done something. I now get stuff on the RTT console when I enter an "r" command to JLink, but not when I power the board on by itself.

    It prints:

    :INFO:Inside main
    :INFO:In nrf_bootloader_init
    :INFO:In real nrf_dfu_init
    :INFO:running nrf_dfu_settings_init
    :INFO:Enter nrf_dfu_continue
    :INFO:Valid App
    :INFO:Enter nrf_dfu_app_is_valid
    :INFO:Return true. App was valid
    :INFO:Enter nrf_dfu_app_is_valid
    :INFO:Return true. App was valid
    :INFO:Jumping to: 0x0001f000
    :INFO:Running nrf_bootloader_app_start with address: 0x0001f000
    :INFO:Disabling interrupts
    :INFO:Setting SD vector table base: 0x0001f000
    

    Not sure what's supposed to happen after that. Holding down button 4 while doing an r/g does nothing (two LEDs on, no RTT).

    So now the question is, how did it ever compile with the SDK's included Makefile? And why is not running on power cycle?

Reply
  • Update: though I never got -O0 to work, fixing the Makefile to add -fomit-frame_pointer to the compilation of nrf_bootloader_app_start.c seems to have done something. I now get stuff on the RTT console when I enter an "r" command to JLink, but not when I power the board on by itself.

    It prints:

    :INFO:Inside main
    :INFO:In nrf_bootloader_init
    :INFO:In real nrf_dfu_init
    :INFO:running nrf_dfu_settings_init
    :INFO:Enter nrf_dfu_continue
    :INFO:Valid App
    :INFO:Enter nrf_dfu_app_is_valid
    :INFO:Return true. App was valid
    :INFO:Enter nrf_dfu_app_is_valid
    :INFO:Return true. App was valid
    :INFO:Jumping to: 0x0001f000
    :INFO:Running nrf_bootloader_app_start with address: 0x0001f000
    :INFO:Disabling interrupts
    :INFO:Setting SD vector table base: 0x0001f000
    

    Not sure what's supposed to happen after that. Holding down button 4 while doing an r/g does nothing (two LEDs on, no RTT).

    So now the question is, how did it ever compile with the SDK's included Makefile? And why is not running on power cycle?

Children
  • Hey Lee Daniel, After demining our way through (we use the pca10040_debug version so that we don't have to bother with most other issues) we ended up a similar situation. We checked that the app is really at the address it should be at (0x0001f000) and we get the same cryptic messages. Is it hang? is it locked in? is something else that's supposed to be there or not there? We successfully uploaded our app but as the bootloader then tries to switch to that app (instead of starting a BLE service waiting for a firmware update) we find ourselves in this deadend. Lee Daniel, if you were able to figure this out, could you share your workaround/solution? that would be tremendously helpful.

Related