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

NRF52 RESET question

Dear Nordic

there are two question find in my software. it may be some matter with thest two question, so put here together.

1.

My software will be reset about several minutes. but no debug output in jlink rtt viewer.

my software is base NUS, and I add a scan , and a advertising, and a lorawan mac. 

#define APP_ADV_INTERVAL 64 /**< The advertising interval (in units of 0.625 ms. This value corresponds to 40 ms). */
#define APP_ADV_TIMEOUT_IN_SECONDS 180

#define SCAN_INTERVAL 0x00A0 /**< Determines scan interval in units of 0.625 millisecond. */
#define SCAN_WINDOW 0x0050 /**< Determines scan window in units of 0.625 millisecond. */
#define SCAN_TIMEOUT 0x0000 /**< Timout when scanning. 0x0000 disables timeout. */

lora mac send one frame in about 7S with SPI.

2, my software print <00> error> ble_gatt: sd_ble_gap_data_length_update() (request) on connection 0x0 returned unexpected value 0x13. 

when nrf connect app link the NUS service.

My SDK is nRF5_SDK_14.2.0_17b948a.

I try to test NUS SDK, it print is error also.

Hope it doesn't matter with the reset.

Thanks!

  • for the 1 reset requestion, I find when adv idle, software goto sleep, then it reset,

    in here   static void on_adv_evt(ble_adv_evt_t ble_adv_evt)
    {
    switch (ble_adv_evt)
    {
    case BLE_ADV_EVT_FAST:
    bsp_indication_set(BSP_INDICATE_ADVERTISING);
    break;
    case BLE_ADV_EVT_IDLE:
    //sleep_mode_enter();       // this line bring out reset
    break;
    default:
    break;
    }
    }

    but I want it go to sleep , like the SDK, thanks for support!

  • Hi Roger,

    My software will be reset about several minutes. but no debug output in jlink rtt viewer.

    The reset happens by default due to APP_ERROR_CHECK() after a function that returned a failed error code other than NRF_SUCCESS. You need to have a breakpoint in the app_error_fault_handler to get the call stack to be able to track which function had APP_ERROR_CHECK that failed. We cannot narrow the problem down based on the info given. Please search your code if there are any other places which calls NVIC_SystemReset() in your code.

    my software print <00> error> ble_gatt: sd_ble_gap_data_length_update() (request) on connection 0x0 returned unexpected value 0x13. 

     This is your application that has initiated data length update procedure and it failed with error 0x13 (NRF_ERROR_RESOURCES). The explanation for this is given in the API documentation clearly says that to be able fix this, you need to increase the event length of the connection before initiating the data length update procedure. Please do so like mentioned in the documentation and this error will go away.

      

  • thanks,sd_ble_cfg_set or set define in sdk_config are all ok for the error return.

    but do you know the first qustion, 

    why my software reset when call sleep_mode_enter();  

    Now I only restart the advertising again when BLE_ADV_EVT_IDLE

    static void on_adv_evt(ble_adv_evt_t ble_adv_evt)
    {
    switch (ble_adv_evt)
    {
    case BLE_ADV_EVT_FAST:
    bsp_indication_set(BSP_INDICATE_ADVERTISING);
    break;
    case BLE_ADV_EVT_IDLE:
    //sleep_mode_enter();       // this line bring out reset
    break;
    default:
    break;
    }

  • The APP_ERROR_CHECK(err_code); inside will restart your chip if the err_code is NOT equal to NRF_SUCCESS. Which means that either bsp_indication_set or bsp_btn_ble_sleep_mode_prepare or sd_power_system_off has failed with an error.

Related