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

ble_app_uart fail about 180seconds

Hi,

I run the "ble_app_uart" from sample program and leave it as it is.
The program ends in NRF_BREAKPOINT_COND with "Fatal error" after a while. 
It is displayed as a screen shot as long as 180 seconds or less.

Environment:

  • SDK 15.2.0
  • SEGGER Embedded Studio Release 4.10a Build 2018110203.37618 Linux x64
  • Raitac MDBT-50Q DB (nRF52840)
    www.raytac.com/.../ins.php

Is there a way to avoid the error?

Parents
  • Hi.

    This happends because after 180 seconds the device should go to sleep.

    When the device is attempting to go to sleep, it calls sd_power_system_off(); in line 332 in main.c, this function call is not allowed while debugging.

    To avoid the error, simply don't call this function while debugging.

    Best regards,

    Andreas

  • Hi , Thank you for the reply.

    Certainly, the description of sleep was in main.c. I also understood that entering sleep during debug will result in an error.

    I did not want to go to sleep, so I did the following.

    (cf., https://devzone.nordicsemi.com/f/nordic-q-a/10465/advertising-forever)

    With this, a long time advertisement has been realized.

    Thank you.

    static void on_adv_evt(ble_adv_evt_t ble_adv_evt)
    {
        uint32_t err_code;
    
        switch (ble_adv_evt)
        {
            case BLE_ADV_EVT_FAST:
                err_code = bsp_indication_set(BSP_INDICATE_ADVERTISING);
                APP_ERROR_CHECK(err_code);
                break;
            case BLE_ADV_EVT_IDLE:
                // sleep_mode_enter();                                                // ( sleep after 180 sec )
                err_code = ble_advertising_start(&m_advertising, BLE_ADV_MODE_FAST);  // modify for infinity advertising
                APP_ERROR_CHECK(err_code);
                break;
            default:
                break;
        }
    }
    

Reply
  • Hi , Thank you for the reply.

    Certainly, the description of sleep was in main.c. I also understood that entering sleep during debug will result in an error.

    I did not want to go to sleep, so I did the following.

    (cf., https://devzone.nordicsemi.com/f/nordic-q-a/10465/advertising-forever)

    With this, a long time advertisement has been realized.

    Thank you.

    static void on_adv_evt(ble_adv_evt_t ble_adv_evt)
    {
        uint32_t err_code;
    
        switch (ble_adv_evt)
        {
            case BLE_ADV_EVT_FAST:
                err_code = bsp_indication_set(BSP_INDICATE_ADVERTISING);
                APP_ERROR_CHECK(err_code);
                break;
            case BLE_ADV_EVT_IDLE:
                // sleep_mode_enter();                                                // ( sleep after 180 sec )
                err_code = ble_advertising_start(&m_advertising, BLE_ADV_MODE_FAST);  // modify for infinity advertising
                APP_ERROR_CHECK(err_code);
                break;
            default:
                break;
        }
    }
    

Children
No Data
Related