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

Can't run modified nrf51-DK example on custom board

Hi. I took the ble_central/experimental/ble_app_blinky_c example and modified it for my needs. It works on the nrf51-DK. Now I want to use it on a custom board with nrf51822qfab. I modified the Makefile in the following way:

changed LINKER_SCRIPT to nrf51_xxab.ld, changed the flags to -DNRF51822.

Run make flash_softdevice, and then make flash. And it doesn't work. (The simple blinky example does work) After hours of trying to understand the problem (this is my first time with Nordic), I found this thread . Now I know that the program gets stuck on

SOFTDEVICE_HANDLER_INIT(&clock_lf_cfg, NULL);

I tried to make the same change in clock settings (like in the thread) but it didn't help... Please help.

Parents
  • Hi,

    I am trying to run experimental_ble_blinky from SDK 12.3 on my custom board having nRF51822QFAA. My starting example .ld file is from PCA10028 (armgcc folder) but i am not able to get it working. I am expecting nRF connect app on my phone to be able scan and discover. However i am not finding it. When i use Eclipsce-Jlink-GDB i am seeing it is not returning from ble_stack_init particularly stuck at softdevice_enable(&ble_enable_params);

    Based on various forum inputs tried the following- tried a example without soft device. Just blinky and it worked

    • Checked basic clock input 16Mhz using code below and found 16M clock source is good NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;

    NRF_CLOCK->TASKS_HFCLKSTART = 1;

    while (!NRF_CLOCK->EVENTS_HFCLKSTARTED);

    • Custom board doesnt have external 32Khz crystal Tried changing nrf_clk_lf_cfg as below and didnt help

    // example default nrf_clock_lf_cfg_t clock_lf_cfg = NRF_CLOCK_LFCLKSRC; nrf_clock_lf_cfg_t clock_lf_cfg = { .source = NRF_CLOCK_LF_SRC_RC,

    .rc_ctiv = 4, // Check temperature every 4 * 250ms

    .rc_temp_ctiv = 1, // Only calibrate if temperature has changed. };

    // Initialize the SoftDevice handler module.

    SOFTDEVICE_HANDLER_INIT(&clock_lf_cfg, NULL);

    • Called sd_power_dcdc_mode_set(NRF_POWER_DCDC_ENABLE); as first funcion inside main() and didnt help either.

    • I am using s130_nrf51_2.0.1_softdevice.hex and .ld script looks this way

    MEMORY

    { FLASH (rx) : ORIGIN = 0x0001B000, LENGTH = 0x25000

    RAM (rwx) : ORIGIN = 0x20001870, LENGTH = 0x2790 }

    • I have a micro:bit hardware as well. The behaviour is very similar there as well though i am using Kiel

    Would be grateful for any solution/pointers. Stuck here for past few days.

    Thank you

Reply
  • Hi,

    I am trying to run experimental_ble_blinky from SDK 12.3 on my custom board having nRF51822QFAA. My starting example .ld file is from PCA10028 (armgcc folder) but i am not able to get it working. I am expecting nRF connect app on my phone to be able scan and discover. However i am not finding it. When i use Eclipsce-Jlink-GDB i am seeing it is not returning from ble_stack_init particularly stuck at softdevice_enable(&ble_enable_params);

    Based on various forum inputs tried the following- tried a example without soft device. Just blinky and it worked

    • Checked basic clock input 16Mhz using code below and found 16M clock source is good NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;

    NRF_CLOCK->TASKS_HFCLKSTART = 1;

    while (!NRF_CLOCK->EVENTS_HFCLKSTARTED);

    • Custom board doesnt have external 32Khz crystal Tried changing nrf_clk_lf_cfg as below and didnt help

    // example default nrf_clock_lf_cfg_t clock_lf_cfg = NRF_CLOCK_LFCLKSRC; nrf_clock_lf_cfg_t clock_lf_cfg = { .source = NRF_CLOCK_LF_SRC_RC,

    .rc_ctiv = 4, // Check temperature every 4 * 250ms

    .rc_temp_ctiv = 1, // Only calibrate if temperature has changed. };

    // Initialize the SoftDevice handler module.

    SOFTDEVICE_HANDLER_INIT(&clock_lf_cfg, NULL);

    • Called sd_power_dcdc_mode_set(NRF_POWER_DCDC_ENABLE); as first funcion inside main() and didnt help either.

    • I am using s130_nrf51_2.0.1_softdevice.hex and .ld script looks this way

    MEMORY

    { FLASH (rx) : ORIGIN = 0x0001B000, LENGTH = 0x25000

    RAM (rwx) : ORIGIN = 0x20001870, LENGTH = 0x2790 }

    • I have a micro:bit hardware as well. The behaviour is very similar there as well though i am using Kiel

    Would be grateful for any solution/pointers. Stuck here for past few days.

    Thank you

Children
Related