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

activating Softdevice s132_nrf52_2.0.0 on nrf52 'ble_app_hids_keyboard_s132_spi_pca10040' app of SDK11

hello there,

I use currently 'ble_app_hids_keyboard_s132_spi_pca10040' app of SDK11 for my nrf52832_xxaa device on 'IAR' IDE. It utilizes sofdevise s132. I do not use the evaluation board.

The nrf52 soc does not have an external 32KHz cyrstal for the LFXO oscillator, only an external 32MHz cyrstal for the HFXO oscillator. I set the HFCLK on main(); like this:

NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
NRF_CLOCK->TASKS_HFCLKSTART = 1;
while(NRF_CLOCK->EVENTS_HFCLKSTARTED == 0) { /* Do nothing */ }

I set the RC oscillator in ble_stack_init() -> nrf_clock_lf_cfg_t clock_lf_cfg = NRF_CLOCK_LFCLKSRC; like this:

#define 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}

then, in 'ser_app_hal_hw_init()' I changed the LFCLKSRC like this:

    NRF_CLOCK->LFCLKSRC            = (CLOCK_LFCLKSRC_SRC_RC << CLOCK_LFCLKSRC_SRC_Pos); //was CLOCK_LFCLKSRC_SRC_Xtal 
    NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
    NRF_CLOCK->TASKS_LFCLKSTART    = 1;

    while (NRF_CLOCK->EVENTS_LFCLKSTARTED == 0)
    {
        //No implementation needed.
    }

thus, I do not stuck at the 'while' loop. but then, I stuck again at: sd_ble_enable() -> ser_sd_transport_cmd_write -> m_os_rsp_wait_handler() -> sd_app_evt_wait();

my memory regions are set like this: linker1.jpg

what might be wrong??

Idan

Related