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

nRF52 softdevice hangs at sd_softdevice_enable when using custom bootloader

I have a problem initializing the ble stack when I'm starting my application via a custom bootloader. I'm using the nrf52832 device on a custom board.

My application has been working fine for a while on its own. But now I want to add a bootloader to the mix...

The memory layout in flash is like this:

0x00000000   - softdevice (s132_nrf52_4.0.2)
0x0001F000   - Primary bootloader
0x00022000   - Main application

There is no overlap in RAM

The point where the execution stops is at sd_softdevice_enable in softdevice_handler.c. I have seen several other questions about this where the solution often seemed to be related to the clock source. However I don't think this is my problem since the application works fine on its own. But I've tried both external and internal clock sources, with the same results:

// external clock source
nrf_clock_lf_cfg_t clock_lf_cfg =
{
    .source        = NRF_CLOCK_LF_SRC_XTAL,
    .rc_ctiv       = 0,
    .rc_temp_ctiv  = 0,
    .xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_30_PPM
};

// internal clock source
nrf_clock_lf_cfg_t clock_lf_cfg =
{
    .source = NRF_CLOCK_LF_SRC_RC,
    .rc_ctiv = 16, // Interval in 0.25 s, 16 * 0.25 = 4 sec
    .rc_temp_ctiv = 2, // Check temperature every .rc_ctiv, but calibrate every .rc_temp_ctiv
    .xtal_accuracy = 0,
};

I'm currently out of ideas as to what could be wrong. Can anyone here point me in the right direction?

Parents
  • Could be that you didn't tell the SD the location of your app. Normally the bootloader does this. You can't just move the PC since the SD will return the program to the normal start location per the SDK unless you tell it otherwise. See this question from someone running two applications: devzone.nordicsemi.com/.../

Reply
  • Could be that you didn't tell the SD the location of your app. Normally the bootloader does this. You can't just move the PC since the SD will return the program to the normal start location per the SDK unless you tell it otherwise. See this question from someone running two applications: devzone.nordicsemi.com/.../

Children
No Data