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

nrf51822 advertising timeout sleep RAM retention

Hello I would like to know when nrf51822 (SDK v12.3 with SD S130 ) advertising timeout and system goes to sleep , how could I retain the ram data so the MCU could work properly when it is woke up by other event? Thanks.

Parents
  • Hi

    When configuring the ble_advertising module you will usually register an event handler in the application, that allows you to change the advertising behavior without having to change the module itself.

    In the standard examples this function is called on_adv_evt(..):

    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();
                break;
            default:
                break;
        }
    }
    

    Best regards

Reply
  • Hi

    When configuring the ble_advertising module you will usually register an event handler in the application, that allows you to change the advertising behavior without having to change the module itself.

    In the standard examples this function is called on_adv_evt(..):

    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();
                break;
            default:
                break;
        }
    }
    

    Best regards

Children
No Data
Related