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

Porting "flash_fstorage" to BLE applications example code

Hello,

I am using Seeger for flashing Code and Debugging. I ported code from “flash_fstorage” example code to “ble_app_blinky”.

In “ble_app_blinky”, as part of wait_for_flash_ready(), I replaced power_manage() to idle_state_handle(). Is this fine. Whether both are same ?

void wait_for_flash_ready(nrf_fstorage_t const * p_fstorage)
{
    /* While fstorage is busy, sleep and wait for an event. */
    while (nrf_fstorage_is_busy(p_fstorage))
    {
        idle_state_handle();
       //power_manage();
    }
}

Thanks & Regards

Vishnu Beema

Parents
  • Hi Vishnu

    This depends on what version of the SDK you are using. This will only be fine in SDK versions 14.0 to 14.2 as that is the only SDK versions where both these functions exist. In older SDK versions the idle_state_handle() does not exist and you should only use power_manage(). In SDK versions 15.0 and newer only idle_state_handle() exists, so there shouldn't be a power_manage function to replace.

    Best regards,

    Simon

Reply
  • Hi Vishnu

    This depends on what version of the SDK you are using. This will only be fine in SDK versions 14.0 to 14.2 as that is the only SDK versions where both these functions exist. In older SDK versions the idle_state_handle() does not exist and you should only use power_manage(). In SDK versions 15.0 and newer only idle_state_handle() exists, so there shouldn't be a power_manage function to replace.

    Best regards,

    Simon

Children
  • Hi Simon,

    Thank you for your inputs.

    I am using nRF52832, SDK_15.3.0, S132 SoftDevice. Using Segger for flash the image.

    I copied power_manage() from FDS (\examples\peripheral\flash_fds) example code to ble_app_blinky example code (\examples\ble_peripheral\ble_app_blinky) of same SDK.

    So both power_manage() (flash_fds) and idle_state_handle() (ble_app_blinky) are present in SDK_15.3.0.

    In this case, in ble_app_blinky code which once should I need to use ?

    Whether can I copy power_manage() and other dependencies from FDS example to ble_app_blinky example code as is ?.

    Thanks & Regards

    Vishnu Beema

Related