Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Softdevice assert (id:0x1 pc:1089e info:0x0)

Our product uses non-connectable/undirected advertising, where advertisement packets are sent every 1 minute for 500ms time. For that we are using FreeRTOS timers to start/stop advertisement.The problem is that randomly either right after the advertisement is started or during the advertisement, app_erro_fault_handler() gets called leading to the system reset (id: 0x1 pc: 0x1089e info: 0x0). What might be the cause based on the given program counter or where would be the best place to start looking for the possible cause for the assert? I cannot disclose  all the specifics about the product sw/hw due NDA but basically we are using nRF52SDKI v12.10 with S132 v3.0.0. Ble control code is modified by removing all the heart sensor etc. related code and just sending specific advertisement packets.

  • Ok, unfortunately, we are still running into the same assert. pc: 0x1117C on 4.0.5 is the same as pc: 0x1089e on v.3.0.0. We will look more into this.

  • Is this on a custom board? Could you try it on a nRF52-DK?

    It could be some issue with the xtal clock not being accurate enough.

  • We indeed have a custom board and I checked that we initialize 16 MHz like this in main.c:

    /* Start 16 MHz crystal oscillator */
    NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
    NRF_CLOCK->TASKS_HFCLKSTART = 1;

    /* Wait for the external oscillator to start up */
    while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0)
    {
    }

    I added following configuration and used it in SOFTDEVICE_HANDLER_INIT:

    #define NRF_CLOCK_LFCLKSRC_RC {.source = NRF_CLOCK_LF_SRC_RC, \
    .rc_ctiv = 16, \
    .rc_temp_ctiv = 2, \
    .xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM}

    static void ble_stack_init(void)
    {
    uint32_t err_code;

    nrf_clock_lf_cfg_t clock_lf_cfg = NRF_CLOCK_LFCLKSRC_RC;

    // Initialize the SoftDevice handler module.
    SOFTDEVICE_HANDLER_INIT(&clock_lf_cfg, ble_new_event_handler);

    ...

    I haven't seen any asserts yet after testing a good amount of time but just to be sure I need to test this few hours. I'll let you know how it goes. 

  • Great, let me know how it goes. Note that on the nRF52 the HFXO is controlled by a 32 MHz external crystal.

    Just so I understand this, did you use 32.768 kHz crystal oscillator(LFXO) when you had the asssert before ? and now you are testing with the 32.768 kHz RC oscillator instead(LFRC)? correct?

    If not, what changes did you try now?

  • That is correct. All I did was that I changed the clock configuration given when initializing SD from NRF_CLOCK_LF_SRC_XTAL to NRF_CLOCK_LF_SRC_RC. So far, after ~30mins or so, no assert.

    Edit: After 17 hours of testing, no assert seen. As summary, in the end this was fixed by changing used clock configuration used to initialize soft device in ble_stack_init().

    static void ble_stack_init(void)
    {
    uint32_t err_code;

    nrf_clock_lf_cfg_t clock_lf_cfg = NRF_CLOCK_LFCLKSRC_RC;

    // Initialize the SoftDevice handler module.
    SOFTDEVICE_HANDLER_INIT(&clock_lf_cfg, ble_new_event_handler);

    ...

    where NRF_CLOCK_LFCLKSRC_RC is:

    #define NRF_CLOCK_LFCLKSRC_RC {.source = NRF_CLOCK_LF_SRC_RC, \
    .rc_ctiv = 16, \
    .rc_temp_ctiv = 2, \
    .xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM}

Related