Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of nrf51-sdk by
bootloader_types.h
00001 /* 00002 * Copyright (c) Nordic Semiconductor ASA 00003 * All rights reserved. 00004 * 00005 * Redistribution and use in source and binary forms, with or without modification, 00006 * are permitted provided that the following conditions are met: 00007 * 00008 * 1. Redistributions of source code must retain the above copyright notice, this 00009 * list of conditions and the following disclaimer. 00010 * 00011 * 2. Redistributions in binary form must reproduce the above copyright notice, this 00012 * list of conditions and the following disclaimer in the documentation and/or 00013 * other materials provided with the distribution. 00014 * 00015 * 3. Neither the name of Nordic Semiconductor ASA nor the names of other 00016 * contributors to this software may be used to endorse or promote products 00017 * derived from this software without specific prior written permission. 00018 * 00019 * 00020 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 00021 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 00022 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00023 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 00024 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00025 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00026 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 00027 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00028 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00029 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00030 * 00031 */ 00032 00033 /**@file 00034 * 00035 * @defgroup nrf_bootloader_types Types and definitions. 00036 * @{ 00037 * 00038 * @ingroup nrf_bootloader 00039 * 00040 * @brief Bootloader module type and definitions. 00041 */ 00042 00043 #ifndef BOOTLOADER_TYPES_H__ 00044 #define BOOTLOADER_TYPES_H__ 00045 00046 #include <stdint.h> 00047 00048 #define BOOTLOADER_DFU_START 0xB1 00049 00050 #define BOOTLOADER_SVC_APP_DATA_PTR_GET 0x02 00051 00052 /**@brief DFU Bank state code, which indicates wether the bank contains: A valid image, invalid image, or an erased flash. 00053 */ 00054 typedef enum 00055 { 00056 BANK_VALID_APP = 0x01, 00057 BANK_VALID_SD = 0xA5, 00058 BANK_VALID_BOOT = 0xAA, 00059 BANK_ERASED = 0xFE, 00060 BANK_INVALID_APP = 0xFF, 00061 } bootloader_bank_code_t; 00062 00063 /**@brief Structure holding bootloader settings for application and bank data. 00064 */ 00065 typedef struct 00066 { 00067 bootloader_bank_code_t bank_0; /**< Variable to store if bank 0 contains a valid application. */ 00068 uint16_t bank_0_crc; /**< If bank is valid, this field will contain a valid CRC of the total image. */ 00069 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. */ 00070 uint32_t bank_0_size; /**< Size of active image in bank0 if present, otherwise 0. */ 00071 uint32_t sd_image_size; /**< Size of SoftDevice image in bank0 if bank_0 code is BANK_VALID_SD. */ 00072 uint32_t bl_image_size; /**< Size of Bootloader image in bank0 if bank_0 code is BANK_VALID_SD. */ 00073 uint32_t app_image_size; /**< Size of Application image in bank0 if bank_0 code is BANK_VALID_SD. */ 00074 uint32_t sd_image_start; /**< Location in flash where SoftDevice image is stored for SoftDevice update. */ 00075 } bootloader_settings_t; 00076 00077 #endif // BOOTLOADER_TYPES_H__ 00078 00079 /**@} */
Generated on Tue Jul 12 2022 11:17:15 by
1.7.2
