/* Function for activating received Application image. 
This function will move the received application image fram swap (bank 1) to application area (bank 0). */
static uint32_t dfu_activate_app(void)
/* Function for activating received Application image. 
This function will move the received application image fram swap (bank 1) to application area (bank 0). */
static uint32_t dfu_activate_app(void)
{
    uint32_t err_code;
    err_code = pstorage_clear(&m_storage_handle_app, m_start_packet.app_image_size);
    APP_ERROR_CHECK(err_code);
    err_code = pstorage_store(&m_storage_handle_app,
                                  (uint8_t *)m_storage_handle_swap.block_id,
                                  m_start_packet.app_image_size,
                                  0);
    if (err_code == NRF_SUCCESS)
    {
        dfu_update_status_t update_status;
        memset(&update_status, 0, sizeof(dfu_update_status_t ));
        update_status.status_code = DFU_UPDATE_APP_COMPLETE;
        update_status.app_crc     = m_image_crc;
        update_status.app_size    = m_start_packet.app_image_size;
        bootloader_dfu_update_process(update_status);
    }
    return err_code;
}