Application halts on softdevice initialize in ble_stack_handler

twing207 gravatar image

asked 2013-12-26 19:47:05 +0100

updated 2013-12-27 18:33:47 +0100

I have a custom board that uses the nrf51822. I have been using the sample application ble_app_uart with only one minor change, I use the internal clock (NRF_CLOCK_LFCLKSRC_RC_250_PPM_4000MS_CALIBRATION) instead of an external 32.768kHz crystal.

This application works great on the dev kit from Nordic. I can connect it to my iPhone no problem. However if I try to run this on my custom hardware it does not work. I run a debug session on my hardware using keil and J-Link LITE CortexM and find that it appears to halt on the line:

// Initialise SoftDevice
    err_code = sd_softdevice_enable(clock_source, softdevice_assertion_handler);

In the file ble_stack_handler.c

So for some reason the softdevice is not initializing. I have tried this on a few modules, both ones of my design and some designed by others and available commercially. On all of them except the Nordic Dev kit I get this same issue. I am using softdevice: s110_nrf51822_6.0.0_softdevice.hex but have also tried the version that was 6.0.0 alpha as well as 5.2.1. All with the same results.

Does anyone know what it is that I am doing wrong?

Thanks Tanner

edit retag flag offensive close delete report spam

1 answer

Sort by ยป oldest newest most voted
twing207 gravatar image

answered 2013-12-27 18:33:42 +0100

A solution was sent to me:

I see you're using the 32Khz calibration clock method (NRF_CLOCK_LFCLKSRC_RC_250_PPM_4000MS_CALIBRATION). This calibration method requires the 16MHz oscillator to be running and working.

From the Ref Manual 2.0 sec 12.1.2 To use the RADIO and the calibration mechanism associated with the 32.768 kHz RC oscillator, the HFCLK must be generated from a HFCLK crystal oscillator.

This method powers up the 16Mhz external xtal every 4000ms and calibrates the 32K RC osc. So actually you do need the: NRF_CLOCK->TASKS_HFCLKSTART = 1; code somewhere.

edit flag offensive delete publish link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer. Do not ask a new question or reply to an answer here.

[hide preview]

User menu

    or sign up

Recent questions

Question Tools


Asked: 2013-12-26 19:47:05 +0100

Seen: 1,693 times

Last updated: des. 27 '13