S110 src\soc_clock.c line 258 assert

Hi,

We are currently developing a embedded system utilizing timeslots. When the device gets awoken from deepsleep we want to get a timeslot as soon as possible in order to conserve battery.

After the SVCALL sd_softdevice_enable we have to delay roughly 3000µs, otherwise we risk (~25%) receiving an error from softdevice_assertion_handler_t with:
PC: 0, line_number: 258, p_file_name: src\soc_clock.c

Is there anyway to mitigate this issue without having a 3000µs delay?

Parents
  • Hi 

    Which version of the S110 and the nRF5 SDK are you using? 

    Have you considered simply delaying the SoftDevice enable call, then you should be able to access SoftDevice resources right away without needing to use timeslots. The question is whether or not this activity needs to go on continuously, or if you could halt it later to give you time to enable the SoftDevice once you need to use it. 

    Best regards
    Torbjørn

  • Hi Torbjørn,

    We found the issue.
    If you request a timeslot with NRF_RADIO_HFCLK_CFG_FORCE_XTAL before SD has gotten the chance to enable XTAL it will give the assert.

    The workaround we implemented:

    SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_RC_250_PPM_TEMP_4000MS_CALIBRATION, NULL);
    
    while((NRF_CLOCK->HFCLKSTAT & CLOCK_HFCLKSTAT_SRC_Msk) != (CLOCK_HFCLKSTAT_SRC_Xtal << CLOCK_HFCLKSTAT_SRC_Pos)) {
        nrf_delay_us(10);
    }
    
    // Continue to request timeslot and, when granted, make use of radio and timer0


    This as far as we know only an issue on S110 and not on S130

  • That's great news Marcus, I will close the ticket then. 

    And as a side note, I would not recommend staring new projects using the S110 and the nRF51 series. 

    Regards
    Torbjørn

Reply Children
Related