BLE FOTA APP

Dependencies:   BLE_API mbed

It doesn't work with the default FOTA bootloader. It use NVIC_SystemReset() to enter a bootloader.

Committer:
yihui
Date:
Fri Oct 10 03:36:28 2014 +0000
Revision:
1:a607cd9655d7
use NVIC_SystemReset() to run bootloader

Who changed what in which revision?

UserRevisionLine numberNew contents of line
yihui 1:a607cd9655d7 1 /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
yihui 1:a607cd9655d7 2 *
yihui 1:a607cd9655d7 3 * The information contained herein is property of Nordic Semiconductor ASA.
yihui 1:a607cd9655d7 4 * Terms and conditions of usage are described in detail in NORDIC
yihui 1:a607cd9655d7 5 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
yihui 1:a607cd9655d7 6 *
yihui 1:a607cd9655d7 7 * Licensees are granted free, non-transferable use of the information. NO
yihui 1:a607cd9655d7 8 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
yihui 1:a607cd9655d7 9 * the file.
yihui 1:a607cd9655d7 10 *
yihui 1:a607cd9655d7 11 */
yihui 1:a607cd9655d7 12
yihui 1:a607cd9655d7 13 /**@file
yihui 1:a607cd9655d7 14 *
yihui 1:a607cd9655d7 15 * @defgroup nrf_bootloader_types Types and definitions.
yihui 1:a607cd9655d7 16 * @{
yihui 1:a607cd9655d7 17 *
yihui 1:a607cd9655d7 18 * @ingroup nrf_bootloader
yihui 1:a607cd9655d7 19 *
yihui 1:a607cd9655d7 20 * @brief Bootloader module type and definitions.
yihui 1:a607cd9655d7 21 */
yihui 1:a607cd9655d7 22
yihui 1:a607cd9655d7 23 #ifndef BOOTLOADER_TYPES_H__
yihui 1:a607cd9655d7 24 #define BOOTLOADER_TYPES_H__
yihui 1:a607cd9655d7 25
yihui 1:a607cd9655d7 26 #include <stdint.h>
yihui 1:a607cd9655d7 27
yihui 1:a607cd9655d7 28 #define BOOTLOADER_DFU_START 0xB1
yihui 1:a607cd9655d7 29
yihui 1:a607cd9655d7 30 /**@brief DFU Bank state code, which indicates wether the bank contains: A valid image, invalid image, or an erased flash.
yihui 1:a607cd9655d7 31 */
yihui 1:a607cd9655d7 32 typedef enum
yihui 1:a607cd9655d7 33 {
yihui 1:a607cd9655d7 34 BANK_VALID_APP = 0x01,
yihui 1:a607cd9655d7 35 BANK_VALID_SD = 0xA5,
yihui 1:a607cd9655d7 36 BANK_VALID_BOOT = 0xAA,
yihui 1:a607cd9655d7 37 BANK_ERASED = 0xFE,
yihui 1:a607cd9655d7 38 BANK_INVALID_APP = 0xFF,
yihui 1:a607cd9655d7 39 } bootloader_bank_code_t;
yihui 1:a607cd9655d7 40
yihui 1:a607cd9655d7 41 /**@brief Structure holding bootloader settings for application and bank data.
yihui 1:a607cd9655d7 42 */
yihui 1:a607cd9655d7 43 typedef struct
yihui 1:a607cd9655d7 44 {
yihui 1:a607cd9655d7 45 bootloader_bank_code_t bank_0; /**< Variable to store if bank 0 contains a valid application. */
yihui 1:a607cd9655d7 46 uint16_t bank_0_crc; /**< If bank is valid, this field will contain a valid CRC of the total image. */
yihui 1:a607cd9655d7 47 bootloader_bank_code_t bank_1; /**< Variable to store if bank 1 has been erased/prepared for new image. Bank 1 is only used in Banked Update scenario. */
yihui 1:a607cd9655d7 48 uint32_t bank_0_size; /**< Size of active image in bank0 if present, otherwise 0. */
yihui 1:a607cd9655d7 49 uint32_t sd_image_size; /**< Size of SoftDevice image in bank0 if bank_0 code is \ref BANK_VALID_SD. */
yihui 1:a607cd9655d7 50 uint32_t bl_image_size; /**< Size of Bootloader image in bank0 if bank_0 code is \ref BANK_VALID_SD. */
yihui 1:a607cd9655d7 51 uint32_t app_image_size; /**< Size of Application image in bank0 if bank_0 code is \ref BANK_VALID_SD. */
yihui 1:a607cd9655d7 52 uint32_t sd_image_start; /**< Location in flash where SoftDevice image is stored for SoftDevice update. */
yihui 1:a607cd9655d7 53 } bootloader_settings_t;
yihui 1:a607cd9655d7 54
yihui 1:a607cd9655d7 55 #endif // BOOTLOADER_TYPES_H__
yihui 1:a607cd9655d7 56
yihui 1:a607cd9655d7 57 /**@} */