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?