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

Secure DFU Bootloader Example not Advertising

I have followed all steps in the recent blog, but the device doesn't advertise. I am using:

  • BMD-300-EVAL devkit (nrf52832)
  • SDK 12.1.0
  • S132 3.0.0
  • Eclipse with gcc-arm-none-eabi-4_9-2015q3
  • Example folder is located in: nRF5_SDK_12.1.0/examples/dfu/bootloader_secure/

I have been using this setup with no issue for the development of other example applications and my own applications.

I notice in sdk_config.h that the clock is disabled. Could this be causing a problem? I tried to enabling it and adding the includes that it needed to the Makefile, but this did not work. Also, it seems that the softdevice is not enabled in main.c. I also tried enabling logging, but this causes a compile error. "region 'FLASH' overflowed by 9748 bytes. I don't know how to fix this so that I can debug.

Where o where am I going wrong?

  • Hi ,

    Could you try to test with SDK v13 ? I haven't heard of issue with the Secure bootloader and gcc except for the buttonless example as summarized here.

    How did you test ? Did you modify anything in the dfu bootloader ? If you simply compile (without modifying anything) and flash the bootloader and the softdevice, would it advertise ?

    You can remove optimization and run the bootloader in debug mode and see where it crashes.

  • Thanks for the super quick response.

    Ok so I started with a completely fresh SDK-13.0.0. I make micro-ecc and copy over public_key.c and adjust the Makefile to point to it.

    Build completes successfully. I flash softdevice v4 and then the bootloader. LED1 and LED3 on BMD-300-EVAL illuminates. NRF Connect shows it's advertising. Yippee!

    I tried building the pca10040_debug. Without changing any optimization levels, it compiles. When I remove optimization (-O0) it gives me this error: ../../../../../components/libraries/bootloader/nrf_bootloader_app_start_asm.c:129:1: error: r7 cannot be used in asm here

    Debugging is useless with optimization as all I can see is disassembly.

    Results for SDK 12.2.0 example are that LED1 and LED3 illuminate. With 12.1.0 there is no illumination. Neither advertise.

    I still want to figure out what's going wrong with SDK 12 as I don't want to have to port over to SDK 13 and S132 v4.

  • SDKv12 should work as well. Could you just try again with the unmodified example ? Maybe a fresh copy ?

    The issue you have with pca10040_debug is that the memory configuration is not big enough when you remove optimization. You need to change the start address of the bootloader to make more room for the bootloader firmware.

  • Hey. I tried a fresh 12.2.0 and 12.1.0. I got 12.2.0 to work after doing all of the normal steps in addition to un-checking "Exported Entries from Referenced Projects" and "CDT Managed Build Settings Entries" from Project Properties->C/C++ General->Preprocessor Includes->Providers. (I fixed some problems I was having with another project by doing that, so I decided to give it a shot.) I Also did a fresh try of 12.1.0, but if I don't change anything (except for the dfu_public.key line), it won't compile. I get the following errors: Cannot find include folder: ../../../../../components/libraries/bootloader/ble_dfu/includes Cannot find include folder: ../../config Cannot find include folder: ../../config/secure_dfu_secure_dfu_ble_s132_pca10040

    If I delete those lines, it compiles.

    At this point, I am probably just gonna bite the bullet and port to SDK 13. Unless you have some great wisom.

  • I would suggest just skip Eclipse, and simply compile using gcc and Make . It should work out of the box (of course with the dfu_public_key.c updated).

Related