Trying to run S130 V2.0.0 with ble_app_proximity on a BLE400 motherboard. Im getting a hang at the call to SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_SYNTH_250_PPM, NULL);
Ive loaded s130 V2.0.0 with nrfgo and at the same time loaded and run blinky into offset memory space with KEIL ok (all 5 leds strobing after making custom_board.h file).
Ive now loaded the ble_app_proximity (s130 still in situ) and I can get it to run but it hangs (resets?) in the call to ble_stack_init() at the soft device handler.
Ive copied the led calls from blinky into the proximity app so I can turn one led on before the call to SOFTDEVICE_HANDLER_INIT() and another led on after. The second led only comes on if I comment out the SOFTDEVICE_HANDLER_INIT() Ive tried all the enums for the SOFTDEVICE_HANDLER_INIT() SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_RC_250_PPM_TEMP_4000MS_CALIBRATION, false); SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_SYNTH_250_PPM, NULL); SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, NULL); // origional
Ive set target options device to nrf51822_xxAC from 51422 Target IROM1 0x1B000, 0x25000 IRAM1 0x20001F00 0x6100 // size doesn’t seem to matter SDK11, Im using a custom board.h file ive made for the ble400 motherboard which works ok with blinky. in my BLE400.h file : #define NRF_CLOCK_LFCLKSRC NRF_CLOCK_LFCLKSRC_XTAL_20_PPM
Ive also tried adding a clock startup before the softdevice_handler but this still doesn't work.
NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos);
NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
NRF_CLOCK->TASKS_LFCLKSTART = 1;
// Wait for the low frequency clock to start
while (NRF_CLOCK->EVENTS_LFCLKSTARTED == 0) {}
NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
If I set my second led to turn on directly after the clock startup code it blinks which makes me think it adds a delay but the next call is causing a reset.
Im not a SW engineer (HW) and have come from a more bare metal background so might not understand some debugging complexities (turning leds on is old school I know) so please point me at manuals if required.