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

SDK15.3 Bootloader hangs sd_softdevice_enable

I'm working on porting a project plus bootloader from SDK 12.2 to 15.3. I have the application working fine, but the bootloader is having some issues. Most of the searches on the topic point to the lfclk settings, but these are working int he application. I'm using a barely modified version of the secure bootloader from the 15.3 sdk. it is custom hardware, but I've been developing on this for almost a year. Application and bootloader work perfectly in 12.2. Application is fully ported to 15.3, and working well.

Following the directions to merge the SD (332 v6.1.1) with the bootloader and settings before flashing.

Everything works correctly after power on. Application starts correctly, BLE and ANT both work. I can issue the command to enter the bootloader usign the GPREGRET, and the device reboots and enters the bootloader, recognizes that it should be there (DFU_START is set correctly). However, it then always hangs at sd_softdevice_enable. It never returns, and thus the bootloader never advertises. 

lfclock settings are the same between the application and the bootloader. Using the 32k oscillator, accuracy 20ppm. (application works fine, but I did try the RC oscillator in the bootloader just to check - no change)

Application flash/ram settings:

MEMORY
{
FLASH (rx) : ORIGIN = 0x30000, LENGTH = 0x48000
RAM (rwx) : ORIGIN = 0x20004000, LENGTH = 0xbc00
}

Bootloader flash/ram settings:

flash: start(x78000), size(x6000)

ram: start(x200057B8), size (xA848)

The application is in Eclipse, the bootloader I'm using the Keil project. I'm able to debug the bootloader a little by attaching to the flashed target after flashing, using J-link.

Any thoughts would be very appreciated.

  • ok, solved it. 2 things going on.

    1) In version 12.2, you did not need to change the bootloader project softdevice headers to v332. The versions of headers for 132 worked fine to turn on the ble stack, and you just never used the ant stack. This is not the case in the new softdevice. My guess is that the SD was crashing on the enable command since it expected an ANT license key, and the SVC call I was using was not providing it. Changing over the headers fixed that. This one is all on me for not doing it correctly.

    2) The SD does NOT like it if you send it a clock config to use the XTAL and have CTIV and TEMP_CTIV set to non-zero. I had changed them while I tried the RC oscillator vs the XTAL. Leaving them non-zero caused an invalid parameter error. I would think that the SD should just know that these parameters are not needed based on the source and the error is not really needed.

    Anyway, works. Thanks to anyone who read it, and I'm posting the answer for anyone who tries to cut corners and hits the same snag.

Related