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
  • Not sure what you mean by "move" the bootloader. It's compiled for 0x75000 and loaded there, and UICR has that address at 0x10001014, and "0x7E000" at 0x10001018. As I aid in the question, I've verified that the code is indeed there.

    I had those sdk_config settings as well as the ones for things like buffer size, all copied from other example projects using RTT.

    I didn't have -O0 because the Makefile supplied with the SDK uses -Os, which compiles fine. When I change it to -O0, the first thing that happens is that it complains about nrf_bootloader_app_start.c having an assembly function that uses R7. Tweaking the Makefile to add -fomit-frame-pointer to the compile line for that file fixes that, but causes the program to grow too large even to fit at 0x75000, as well as causing a link error with "nrf_drv_rng_block_rand".

Reply
  • Not sure what you mean by "move" the bootloader. It's compiled for 0x75000 and loaded there, and UICR has that address at 0x10001014, and "0x7E000" at 0x10001018. As I aid in the question, I've verified that the code is indeed there.

    I had those sdk_config settings as well as the ones for things like buffer size, all copied from other example projects using RTT.

    I didn't have -O0 because the Makefile supplied with the SDK uses -Os, which compiles fine. When I change it to -O0, the first thing that happens is that it complains about nrf_bootloader_app_start.c having an assembly function that uses R7. Tweaking the Makefile to add -fomit-frame-pointer to the compile line for that file fixes that, but causes the program to grow too large even to fit at 0x75000, as well as causing a link error with "nrf_drv_rng_block_rand".

Children
No Data
Related