Nordic stack and drivers for the mbed BLE API
Dependents: Sensen-classic-v8-IAQ_copy_4
Fork of nRF51822 by
TARGET_MCU_NRF51822/sdk/source/libraries/bootloader_dfu/bootloader_types.h@639:7f459d371b75, 2017-11-10 (annotated)
- Committer:
- amithy
- Date:
- Fri Nov 10 20:27:44 2017 +0000
- Revision:
- 639:7f459d371b75
- Parent:
- 638:c90ae1400bf2
t
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Vincent Coubard |
638:c90ae1400bf2 | 1 | /* |
Vincent Coubard |
638:c90ae1400bf2 | 2 | * Copyright (c) Nordic Semiconductor ASA |
Vincent Coubard |
638:c90ae1400bf2 | 3 | * All rights reserved. |
Vincent Coubard |
638:c90ae1400bf2 | 4 | * |
Vincent Coubard |
638:c90ae1400bf2 | 5 | * Redistribution and use in source and binary forms, with or without modification, |
Vincent Coubard |
638:c90ae1400bf2 | 6 | * are permitted provided that the following conditions are met: |
Vincent Coubard |
638:c90ae1400bf2 | 7 | * |
Vincent Coubard |
638:c90ae1400bf2 | 8 | * 1. Redistributions of source code must retain the above copyright notice, this |
Vincent Coubard |
638:c90ae1400bf2 | 9 | * list of conditions and the following disclaimer. |
Vincent Coubard |
638:c90ae1400bf2 | 10 | * |
Vincent Coubard |
638:c90ae1400bf2 | 11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this |
Vincent Coubard |
638:c90ae1400bf2 | 12 | * list of conditions and the following disclaimer in the documentation and/or |
Vincent Coubard |
638:c90ae1400bf2 | 13 | * other materials provided with the distribution. |
Vincent Coubard |
638:c90ae1400bf2 | 14 | * |
Vincent Coubard |
638:c90ae1400bf2 | 15 | * 3. Neither the name of Nordic Semiconductor ASA nor the names of other |
Vincent Coubard |
638:c90ae1400bf2 | 16 | * contributors to this software may be used to endorse or promote products |
Vincent Coubard |
638:c90ae1400bf2 | 17 | * derived from this software without specific prior written permission. |
Vincent Coubard |
638:c90ae1400bf2 | 18 | * |
Vincent Coubard |
638:c90ae1400bf2 | 19 | * |
Vincent Coubard |
638:c90ae1400bf2 | 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
Vincent Coubard |
638:c90ae1400bf2 | 21 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
Vincent Coubard |
638:c90ae1400bf2 | 22 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
Vincent Coubard |
638:c90ae1400bf2 | 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR |
Vincent Coubard |
638:c90ae1400bf2 | 24 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
Vincent Coubard |
638:c90ae1400bf2 | 25 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
Vincent Coubard |
638:c90ae1400bf2 | 26 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
Vincent Coubard |
638:c90ae1400bf2 | 27 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
Vincent Coubard |
638:c90ae1400bf2 | 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
Vincent Coubard |
638:c90ae1400bf2 | 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Vincent Coubard |
638:c90ae1400bf2 | 30 | * |
Vincent Coubard |
638:c90ae1400bf2 | 31 | */ |
Vincent Coubard |
638:c90ae1400bf2 | 32 | |
Vincent Coubard |
638:c90ae1400bf2 | 33 | /**@file |
Vincent Coubard |
638:c90ae1400bf2 | 34 | * |
Vincent Coubard |
638:c90ae1400bf2 | 35 | * @defgroup nrf_bootloader_types Types and definitions. |
Vincent Coubard |
638:c90ae1400bf2 | 36 | * @{ |
Vincent Coubard |
638:c90ae1400bf2 | 37 | * |
Vincent Coubard |
638:c90ae1400bf2 | 38 | * @ingroup nrf_bootloader |
Vincent Coubard |
638:c90ae1400bf2 | 39 | * |
Vincent Coubard |
638:c90ae1400bf2 | 40 | * @brief Bootloader module type and definitions. |
Vincent Coubard |
638:c90ae1400bf2 | 41 | */ |
Vincent Coubard |
638:c90ae1400bf2 | 42 | |
Vincent Coubard |
638:c90ae1400bf2 | 43 | #ifndef BOOTLOADER_TYPES_H__ |
Vincent Coubard |
638:c90ae1400bf2 | 44 | #define BOOTLOADER_TYPES_H__ |
Vincent Coubard |
638:c90ae1400bf2 | 45 | |
Vincent Coubard |
638:c90ae1400bf2 | 46 | #include <stdint.h> |
Vincent Coubard |
638:c90ae1400bf2 | 47 | |
Vincent Coubard |
638:c90ae1400bf2 | 48 | #define BOOTLOADER_DFU_START 0xB1 |
Vincent Coubard |
638:c90ae1400bf2 | 49 | |
Vincent Coubard |
638:c90ae1400bf2 | 50 | #define BOOTLOADER_SVC_APP_DATA_PTR_GET 0x02 |
Vincent Coubard |
638:c90ae1400bf2 | 51 | |
Vincent Coubard |
638:c90ae1400bf2 | 52 | /**@brief DFU Bank state code, which indicates wether the bank contains: A valid image, invalid image, or an erased flash. |
Vincent Coubard |
638:c90ae1400bf2 | 53 | */ |
Vincent Coubard |
638:c90ae1400bf2 | 54 | typedef enum |
Vincent Coubard |
638:c90ae1400bf2 | 55 | { |
Vincent Coubard |
638:c90ae1400bf2 | 56 | BANK_VALID_APP = 0x01, |
Vincent Coubard |
638:c90ae1400bf2 | 57 | BANK_VALID_SD = 0xA5, |
Vincent Coubard |
638:c90ae1400bf2 | 58 | BANK_VALID_BOOT = 0xAA, |
Vincent Coubard |
638:c90ae1400bf2 | 59 | BANK_ERASED = 0xFE, |
Vincent Coubard |
638:c90ae1400bf2 | 60 | BANK_INVALID_APP = 0xFF, |
Vincent Coubard |
638:c90ae1400bf2 | 61 | } bootloader_bank_code_t; |
Vincent Coubard |
638:c90ae1400bf2 | 62 | |
Vincent Coubard |
638:c90ae1400bf2 | 63 | /**@brief Structure holding bootloader settings for application and bank data. |
Vincent Coubard |
638:c90ae1400bf2 | 64 | */ |
Vincent Coubard |
638:c90ae1400bf2 | 65 | typedef struct |
Vincent Coubard |
638:c90ae1400bf2 | 66 | { |
Vincent Coubard |
638:c90ae1400bf2 | 67 | bootloader_bank_code_t bank_0; /**< Variable to store if bank 0 contains a valid application. */ |
Vincent Coubard |
638:c90ae1400bf2 | 68 | uint16_t bank_0_crc; /**< If bank is valid, this field will contain a valid CRC of the total image. */ |
Vincent Coubard |
638:c90ae1400bf2 | 69 | 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. */ |
Vincent Coubard |
638:c90ae1400bf2 | 70 | uint32_t bank_0_size; /**< Size of active image in bank0 if present, otherwise 0. */ |
Vincent Coubard |
638:c90ae1400bf2 | 71 | uint32_t sd_image_size; /**< Size of SoftDevice image in bank0 if bank_0 code is BANK_VALID_SD. */ |
Vincent Coubard |
638:c90ae1400bf2 | 72 | uint32_t bl_image_size; /**< Size of Bootloader image in bank0 if bank_0 code is BANK_VALID_SD. */ |
Vincent Coubard |
638:c90ae1400bf2 | 73 | uint32_t app_image_size; /**< Size of Application image in bank0 if bank_0 code is BANK_VALID_SD. */ |
Vincent Coubard |
638:c90ae1400bf2 | 74 | uint32_t sd_image_start; /**< Location in flash where SoftDevice image is stored for SoftDevice update. */ |
Vincent Coubard |
638:c90ae1400bf2 | 75 | } bootloader_settings_t; |
Vincent Coubard |
638:c90ae1400bf2 | 76 | |
Vincent Coubard |
638:c90ae1400bf2 | 77 | #endif // BOOTLOADER_TYPES_H__ |
Vincent Coubard |
638:c90ae1400bf2 | 78 | |
Vincent Coubard |
638:c90ae1400bf2 | 79 | /**@} */ |