This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ble_app_template is not initiating

Hello

I was trying to get this example ble_app_template to work but it seems like it doesn't, the code is executed on the ic since I was uploading some code to blink a light at certain points along the code and it seems like it doesn't blink after function "ble_stack_init();" is called. Pressing button 0 doesn't work either, I'm using the pca20006 board header file but for a custom pcb with the nrf51802 chip on it. It looks like this:  .  I tried to see if rtt gives me anything but I couldn't get anything out of there, not even log info. Almost no code has been edited from the template code more than Makefile and linker script to adapt for nrf51802 instead of nrf51422 that is supposed to be used for pca20006.

To summarise, program is stuck after ble_stack_init() is called. RTT doesn't work either which should be for another ticket, but could be good to know. 

OS: Linux debian

softdevice: s130

ic: nrf51802

link: segger jlink base

topic: bluetooth low energy

  • Hello,

    It looks like your comes without the optional 32 KHz crystal mounted. In that case, you have to change the clock source from the crystal oscillator (default) to the internal RC oscillator for the Softdevice to work (stack requires a slow clock for timekeeping of connection intervals, etc). Otherwise the Softdevice will attempt to start the crystal and enter an endless loop waiting for the crystal to ramp up.

    To change the clock source you can update the NRF_CLOCK_LFCLKSRC define in your board header to this:

    NRF_CLOCK_LFCLKSRC  { .source        = NRF_CLOCK_LF_SRC_RC,            \
                          .rc_ctiv       = 16,                             \
                          .rc_temp_ctiv  = 2,                              \
                          .xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM //parameter is ignored when using RC }

    For details about what each of the parameter above does, please refer to the nrf_clock_lf_cfg_t struct.

    Best regards,

    Vidar

  • Thank you Vidar that worked very well!

Related