/* Function for preparing of flash before receiving SoftDevice image. 
This function will erase current application area to ensure sufficient amount of storage for the SoftDevice image. Upon erase complete a callback will be done. See dfu_bank_prepare_t for further details.  */
static void dfu_prepare_func_app_erase(uint32_t image_size)
/* Function for preparing of flash before receiving SoftDevice image. 
This function will erase current application area to ensure sufficient amount of storage for the SoftDevice image. Upon erase complete a callback will be done. See dfu_bank_prepare_t for further details.  */
static void dfu_prepare_func_app_erase(uint32_t image_size)
{
    uint32_t err_code;
    mp_storage_handle_active = &m_storage_handle_app;
    m_dfu_state = DFU_STATE_PREPARING;
    err_code    = pstorage_clear(&m_storage_handle_app, m_image_size);
    APP_ERROR_CHECK(err_code);
}