TI BLE-Stack for Bluetooth API Documentation  3.03.08.00
ext_flash_layout.h
Go to the documentation of this file.
1 /******************************************************************************
2 
3  @file ext_flash_layout.h
4 
5  @brief Contains common structures and defines related to external flash
6  layout as it for the OAD usecase
7 
8  Group: WCS, BTS
9  $Target Device: DEVICES $
10 
11  ******************************************************************************
12  $License: BSD3 2015 $
13  ******************************************************************************
14  $Release Name: PACKAGE NAME $
15  $Release Date: PACKAGE RELEASE DATE $
16  *****************************************************************************/
17 
46 #ifndef EXT_FLASH_LAYOUT_H
47 #define EXT_FLASH_LAYOUT_H
48 
49 #ifdef __cplusplus
50 extern "C"
51 {
52 #endif
53 
54 /*******************************************************************************
55  * INCLUDES
56  ******************************************************************************/
57 
58 #include "oad_image_header.h"
59 
68 #define OAD_EFL_MAGIC {'O', 'A', 'D', ' ', 'N', 'V', 'M', '1'}
69 
73 #define OAD_EFL_MAGIC_SZ 8
74 
79 #define EFL_ADDR_META 0x00000
80 
85 #define EFL_SIZE_META EFL_PAGE_SIZE
86 
91 #define EFL_META_PG_INVALID 0xFF
92 
97 #define EFL_FACT_IMG_META_PG 0
98 
102 #define EFL_ADDR_META_FACT_IMG EFL_ADDR_META
103 
107 #define EFL_META_COPY_SZ offsetof(ExtImageInfo_t, fixedHdr.rfu) + \
108  sizeof(((ExtImageInfo_t){0}).fixedHdr.rfu)
109 
113 #define EFL_METADATA_LEN sizeof(ExtImageInfo_t)
114 
119 #define EFL_IMG_STR_ADDR_OFFSET offsetof(ExtImageInfo_t, extFlAddr)
120 
124 #define EFL_META_COUNTER_OFFSET offsetof(ExtImageInfo_t, counter)
125 
129 #define EFL_FACT_IMG_0_ADDR EFL_FLASH_SIZE - EFL_MAX_IMG_SZ
130 
134 #define EFL_FACT_IMG_1_ADDR EFL_FACT_IMG_0_ADDR - EFL_MAX_IMG_SZ
135 
139 #define EFL_USR_AREA_ADDR EFL_SIZE_META*EFL_MAX_META
140 
144 #define EFL_USR_AREA_SZ EFL_IMG_SPACE_START - EFL_USR_AREA_ADDR
145 
149 #define EFL_IMG_SPACE_START EFL_APP_IMG_SZ
150 
154 #define EFL_MAX_META 4
155 
159 #define EFL_IMG_SPACE_END (EFL_FACT_IMG_1_ADDR - 1)
160 
164 #define EFL_NUM_FACT_IMAGES 2
165 
169 #define EFL_PAGE_SIZE 0x1000
170 
174 #define EFL_MAX_IMG_SZ 0x20000
175 
179 #define EFL_APP_IMG_SZ 0x10000
180 
186 {
187  imgFixedHdr_t fixedHdr;
188  uint32_t extFlAddr;
189  uint32_t counter;
190 } ExtImageInfo_t;
191 
193 #ifdef __cplusplus
194 }
195 #endif
196 
197 
198 #endif /* EXT_FLASH_LAYOUT_H */
TYPEDEF_STRUCT_PACKED
External flash image header used to populate the table of image headers in external flash...
Definition: ext_flash_layout.h:186
uint32_t counter
Timestamp/counter of image.
Definition: ext_flash_layout.h:189
uint32_t extFlAddr
Location of the image in ext flash.
Definition: ext_flash_layout.h:188
Structure definition for image header and segments, these are prepended to the over the air images...
© Copyright 1995-2021, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale