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

About reset during advertising

SDK: 15.3.0
Example: ble_app_multirole_lesc
Device: EYSHJNZWZ (nRF52832)

After calling "ble_advertising_start" to start advertising, call "sd_app_evt_wait" to transition to sleep.
Approximately 7 minutes after calling "sd_app_evt_wait", it appears to be reset.
Please tell me about this cause.


As a side note, I am using WDT.
This does not occur when WDT is disabled.
Therefore, we believe that the cause is WDT.
WDT is cleared when it is released from sleep.
However, after calling "sd_app_evt_wait", it was not woken from sleep.
Therefore, it is always in a sleep state.
I am setting the WDT as follows.
I think WDT is disabled during sleep.

#define WDT_CONFIG_BEHAVIOUR							0

Also, when "ble_advertising_start" is not called, this phenomenon does not occur.

  • Is the sleep mode released at each advertisement interval?
    Since the next process of "sd_app_evt_wait" is not running, I don't think sleep is released at application level.
    However, is the sleep released at SoftDevice level?
    WDT is updated when sleep is released at SoftDevice?

  • Hi Takashina, 

    How did you feed the WDT ?  What was the reload value you used ? 

    Usually the WDT should be fed using a timer. I think the reason that WDT timer trigger a reset is because sd_app_evt_wait() will put the CPU to sleep and will not jump back to the application if there is no interrupt in the application. This mean, the CPU still wake up on softdevice activity (BLE activity) but it won't execute the WDT feeding code in the loop you have. This result that the WDT will still run when CPU is active (when there is BLE event) but it won't get fed. After a few minutes the WDT will timeout. 

    I would suggest to use a timer to feed the WDT. 
    Otherwise you can think of avoid using sd_app_evt_wait() but use these commands instead : 

    __WFE();

    __WFE();

    __SEV();

    This will allow the CPU to wakeup and execute the feeding WDT task on any CPU activity. 

  • Thank you for answering.

    >> How did you feed the WDT? What was the reload value you used?
    The setting of WDT is shown below.

    #define WDT_ENABLED						1
    #define WDT_CONFIG_BEHAVIOUR			0
    #define WDT_CONFIG_RELOAD_VALUE			3800
    #define WDT_CONFIG_IRQ_PRIORITY			6
    #define NRFX_WDT_CONFIG_NO_IRQ 			1
    
    
    ret_code_t					err_code;
    nrf_drv_wdt_config_t		config = NRF_DRV_WDT_DEAFULT_CONFIG;
    err_code = nrf_drv_wdt_init(
    								&config,
    								NULL
    );
    APP_ERROR_CHECK(err_code);
    
    err_code = nrf_drv_wdt_channel_alloc(
    								&s_wdt_channel_id
    );
    APP_ERROR_CHECK(err_code);
    
    nrf_drv_wdt_enable(
    );

    >> I would suggest to use a timer to feed the WDT.
    I want to reduce power consumption.
    Therefore, I do not want to use the timer.

  • >> Otherwise you can think of avoid using sd_app_evt_wait () but use these commands instead:
    >> __WFE ();
    >> __WFE ();
    >> __SEV ();
    >> This will allow the CPU to wakeup and execute the feeding WDT task on any CPU activity.

    I tried the above process.
    When the CPU wakes up, it also wakes up at the application level.
    As a result, the WDT clear process runs and the WDT reset phenomenon no longer occurs.
    Thank you for teaching me.
    However, I do not understand what "__WFE ()" and "__SEV ()" do.
    Can you tell us about these roles?

  • Please tell me another.
    Current consumption increased when using "__WFE ()" and "__SEV ()" instead of "sd_app_evt_wait".
    Even just changing "sd_app_evt_wait" to "__WFE ()" increased current consumption.
    I cannot tolerate this increase in current consumption.
    Please tell me about this cause.
    Please let me know if there are any other measures.

Related