gr55xx_dfu.h
Go to the documentation of this file.
1 /**
2 ******************************************************************************
3 *
4 * @file gr55xx_dfu.h
5 *
6 * @brief Device Firmware Update API
7 *
8 ******************************************************************************
9 * @attention
10 #####Copyright (c) 2019 GOODIX
11 All rights reserved.
12
13 Redistribution and use in source and binary forms, with or without
14 modification, are permitted provided that the following conditions are met:
15 * Redistributions of source code must retain the above copyright
16 notice, this list of conditions and the following disclaimer.
17 * Redistributions in binary form must reproduce the above copyright
18 notice, this list of conditions and the following disclaimer in the
19 documentation and/or other materials provided with the distribution.
20 * Neither the name of GOODIX nor the names of its contributors may be used
21 to endorse or promote products derived from this software without
22 specific prior written permission.
23
24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
28 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 POSSIBILITY OF SUCH DAMAGE.
35 *****************************************************************************************
36 */
37
38 /**
39 * @addtogroup SYSTEM
40 * @{
41 */
42 /**
43 @addtogroup DFU Device Firmware Update
44 @{
45 @brief Definitions and prototypes for the DFU interface.
46 */
47
48 #ifndef __GR55XX_DFU_H__
49 #define __GR55XX_DFU_H__
50
51 #include <stdbool.h>
52 #include <stdint.h>
53
54 /** @addtogroup DFU_DEFINES Defines
55 * @{ */
56 #define DFU_ADV_MAX_LENGTH 18 /**< The max length of advertisement is 18 bytes. */
57 #define RECEIVE_MAX_LEN 2048 /**< The max length of received data is 2048 bytes. */
58
59 /**@defgroup DFU_CMD_DISABLE DFU cmd disable option (bitmask)
60 * @{ */
61 #define DFU_WRITE_RAM_DISABLE 0x0001 /**< Disable DFU write ram. */
62 #define DFU_READ_RAM_DISABLE 0x0002 /**< Disable DFU read ram. */
63 #define DFU_DUMP_FLASH_DISABLE 0x0004 /**< Disable DFU dump flash. */
64 #define DFU_ERASE_FLASH_DISABLE 0x0008 /**< Disable DFU erase flash. */
65 #define DFU_UPDAE_FLASH_DISABLE 0x0010 /**< Disable DFU update flash. */
66 #define DFU_OPERATE_SYSTEM_INFO_DISABLE 0x0020 /**< Disable DFU operate system info area. */
67 #define DFU_OPERATE_NVDS_DISABLE 0x0040 /**< Disable DFU operate NVDS. */
68 #define DFU_OPERATE_EFUSE_DISABLE 0x0080 /**< Disable DFU operate EFUSE. */
69 #define DFU_CONFIG_SPI_FLASH_DISABLE 0x0100 /**< Disable DFU config spi flash. */
70 #define DFU_OPERATE_REG_DISABLE 0x0200 /**< Disable DFU operate register. */
71 /**@} */
72
73 /** @} */
74
75 /**@addtogroup DFU_ENUMERATIONS Enumerations
76 * @{ */
77
78 /**@brief UART baudrate definition. */
79 typedef enum
80 {
81 DFU_UART_BAUDRATE_9600 = 9600, /**< Baudrate 9600. */
82 DFU_UART_BAUDRATE_19200 = 19200, /**< Baudrate 19200. */
83 DFU_UART_BAUDRATE_38400 = 38400, /**< Baudrate 38400. */
84 DFU_UART_BAUDRATE_57600 = 57600, /**< Baudrate 57600. */
85 DFU_UART_BAUDRATE_115200 = 115200, /**< Baudrate 115200. */
86 DFU_UART_BAUDRATE_230400 = 230400, /**< Baudrate 230400. */
87 DFU_UART_BAUDRATE_921600 = 921600, /**< Baudrate 921600. */
88 } dfu_uart_baudrate_t;
89
90 /**@brief UART data bit definition. */
91 typedef enum
92 {
93 DFU_UART_DATA_BIT_5 = 0, /**< Data bit 5. */
94 DFU_UART_DATA_BIT_6, /**< Data bit 6. */
95 DFU_UART_DATA_BIT_7, /**< Data bit 7. */
96 DFU_UART_DATA_BIT_8, /**< Data bit 8. */
97 } dfu_uart_data_bit_t;
98
99 /**@brief UART stop bit definition. */
100 typedef enum
101 {
102 DFU_UART_STOP_BIT_1 = 0, /**< Stop bit 1. Avaliable when data bit = 5,6,7,8. */
103 DFU_UART_STOP_BIT_1_5, /**< Stop bit 1.5. Avaliable when data bit = 5. */
104 DFU_UART_STOP_BIT_2, /**< Stop bit 2. Avaliable when data bit = 6,7,8. */
105 } dfu_uart_stop_bit_t;
106
107 /**@brief UART parity definition. */
108 typedef enum
109 {
110 DFU_UART_PARITY_NONE = 0, /**< Parity none. */
111 DFU_UART_PARITY_ODD, /**< Parity odd. */
112 DFU_UART_PARITY_EVEN, /**< Parity even. */
113 DFU_UART_PARITY_SP_0, /**< Parity stick 0. */
114 DFU_UART_PARITY_SP_1, /**< Parity stick 1. */
115 } dfu_uart_parity_bit_t;
116
117 /**@brief UART pin group definition. */
118 typedef enum
119 {
120 DFU_UART_PIN_GROUP_0 = 0, /**< GPIO0_PIN3 -> UART0_TXD(MUX0),GPIO0_PIN4 -> UART0_RXD(MUX0)*/
121 DFU_UART_PIN_GROUP_1, /**< GPIO0_PIN10 -> UART0_TXD(MUX2),GPIO0_PIN11 -> UART0_RXD(MUX2)*/
122 DFU_UART_PIN_GROUP_2, /**< GPIO0_PIN0 -> UART0_TXD(MUX4),GPIO0_PIN1 -> UART0_RXD(MUX4)*/
123 DFU_UART_PIN_GROUP_3, /**< GPIO1_PIN14 -> UART0_TXD(MUX5),GPIO1_PIN10 -> UART0_RXD(MUX5)*/
124 DFU_UART_PIN_GROUP_4, /**< GPIO0_PIN7 -> UART1_TXD(MUX3),GPIO0_PIN6 -> UART1_RXD(MUX3)*/
125 DFU_UART_PIN_GROUP_5, /**< GPIO0_PIN9 -> UART1_TXD(MUX3),GPIO0_PIN8 -> UART1_RXD(MUX3)*/
126 } dfu_uart_pin_group_t;
127
128 /**@brief DFU informatica status. */
129 typedef enum
130 {
131 DFU_INFO_DISABLE = 0x5775, /**< DFU Config Info Disable. */
132 DFU_INFO_ENABLE = 0x7ff7, /**< DFU Config Info Enable. */
133 DFU_INFO_DEFAULT = 0x4774, /**< DFU Config Info DEFAULT */
134 } dfu_info_state;
135 /** @} */
136
137 /**@addtogroup DFU_STRUCTURES Structures
138 * @{ */
139
140 /**@brief BootLoader information definition. */
141 typedef struct
142 {
143 uint32_t bin_size; /**< Firmware Size. */
144 uint32_t check_sum; /**< Firmware Check Sum Value. */
145 uint32_t load_addr; /**< Firmware Load Address. */
146 uint32_t run_addr ; /**< Firmware Run Address. */
147 uint32_t xqspi_xip_cmd; /**< XIP Read Mode. 0x03: Read mode, 0x0B: Fast Read mode, 0x3B: DualOut Fast Read mode,
148 0xBB: DualIO Fast Read mode, 0x6B: QuadOut Fast Read mode, 0xEB: QuadIO Fast Read mode */
149 uint32_t xqspi_speed: 4; /**< Bit: 0-3 clock speed. 0 :64 MHz, 1:48 MHz, 2:32 MHz, 3:24 MHz, 4:16 MHz. */
150 uint32_t code_copy_mode: 1; /**< Bit: 4 code copy mode. 0:XIP,1:QSPI. */
151 uint32_t system_clk: 3; /**< Bit: 5-7 system clock. 0:64 MHz, 1:48 MHz, 2:32 MHz(xo), 3:24 MHz, 4:16 MHz, 5:32 MHz(cpll). */
152 uint32_t check_image:1; /**< Bit: 8 check image. */
153 uint32_t boot_delay:1; /**< Bit: Boot delay flag. */
154 uint32_t is_dap_boot:1; /**< Bit: 11 check if boot dap mode. */
155 uint32_t reserved:21; /**< Bit: 24 reserved. */
156 } boot_info_t;
157
158
159 /**@brief DFU uart config definition. */
160 typedef struct
161 {
162 dfu_info_state state; /**< DFU UART Enable or Disable. This parameter can be a value of @ref dfu_info_state.*/
163 dfu_uart_baudrate_t baud_rate; /**< UART communication baudrate. This parameter can be a value of @ref dfu_uart_baudrate_t.*/
164 dfu_uart_data_bit_t data_bit; /**< The number of data bits transmitted or received in a frame. This parameter can be a value of @ref dfu_uart_data_bit_t.*/
165 dfu_uart_stop_bit_t stop_bits; /**< The number of stop bits transmitted. This parameter can be a value of @ref dfu_uart_stop_bit_t.*/
166 dfu_uart_parity_bit_t parity; /**< Specify the parity mode. This parameter can be a value of @ref dfu_uart_parity_bit_t.*/
167 dfu_uart_pin_group_t pin_group; /**< Uart pin group. This parameter can be a value of @ref dfu_uart_pin_group_t.*/
168 } dfu_uart_info_t;
169
170 /**@brief DFU Advertisement name config definition. */
171 typedef struct
172 {
173 dfu_info_state state; /**< If a set name is used, this parameter can be a value of @ref dfu_info_state.*/
174 uint8_t adv_name[DFU_ADV_MAX_LENGTH]; /**< Adv name data. */
175 uint16_t adv_name_length; /**< The length of the name. */
176 } dfu_adv_name_info_t;
177
178 /**@brief DFU NVDS init info definition. */
179 typedef struct
180 {
181 dfu_info_state state; /**< If NVDS init is required, this parameter can be a value of @ref dfu_info_state.*/
182 uint16_t page_size; /**< NVDS page size. */
183 uint32_t start_address; /**< NVDS start address. */
184 }dfu_nvds_info_t;
185
186 /**@brief DFU cmd disable info definition. */
187 typedef struct
188 {
189 dfu_info_state state; /**< If DFU cmd disable config is required, this parameter can be a value of @ref dfu_info_state.*/
190 uint16_t cmd_bit_map; /**< NVDS start address. */
191 }dfu_cmd_disable_t;
192
193
194 /**@brief DFU used functions config definition. */
195 typedef struct
196 {
197 void (*dfu_ble_send_data)(uint8_t *p_data, uint16_t length); /**< The function is used to send data to master by BLE. */
198 void (*dfu_uart_send_data)(uint8_t *p_data, uint16_t length); /**< The function is used to send data to master by UART. */
199 uint32_t (*dfu_flash_read)(const uint32_t addr, uint8_t *p_buf, const uint32_t size); /**< The function is used to read data from flash. */
200 uint32_t (*dfu_flash_write)(const uint32_t addr, const uint8_t *p_buf, const uint32_t size); /**< The function is used to write data to flash. */
201 bool (*dfu_flash_erase)(const uint32_t addr, const uint32_t size); /**< The function is used to erase flash by address. */
202 bool (*dfu_flash_erase_chip)(void); /**< The function is used to erase flash chip. */
203 void (*dfu_flash_set_security)(bool enable); /**< The function is used to set the flash security mode as Enable or Disable. */
204 bool (*dfu_flash_get_security)(void); /**< The function is used to get the flash security mode (Enable or Disable). */
205 void (*dfu_flash_get_info)(uint32_t *id, uint32_t *size); /**< The function is used to get the flash id and size. */
206 } dfu_func_t;
207
208 /**@brief SPI used functions config definition. */
209 typedef struct
210 {
211 void (*dfu_spi_flash_init)(uint8_t *p_data); /**< The function is used to config flash spi. */
212 uint32_t (*dfu_spi_flash_read)(uint32_t addr, uint8_t *buf, uint32_t size); /**< The function is used to read external flash . */
213 uint32_t (*dfu_spi_flash_write)(uint32_t addr, uint8_t *buf, uint32_t size); /**< The function is used to write external flash. */
214 bool (*dfu_spi_flash_erase)(uint32_t addr, uint32_t size); /**< The function is used to erase external flash by address. */
215 bool (*dfu_spi_flash_erase_chip)(void); /**< The function is used to erase exteral flash chip. */
216 void (*dfu_spi_flash_get_info)(uint32_t *id, uint32_t *size); /**< The function is used to get external flash id and size. */
217 }dfu_spi_flash_func_t;
218
219
220 /**@brief DFU program state callback definition. */
221 typedef struct
222 {
223 void (*dfu_program_start_callback)(void); /**<DFU program start callback. */
224 void (*dfu_programing_callback)(uint8_t pro); /**<DFU programing callback. */
225 void (*dfu_program_end_callback)(uint8_t status); /**<DFU program end callback. */
226 } dfu_pro_callback_t;
227
228 /** @} */
229
230
231 /** @addtogroup DFU_FUNCTIONS Functions
232 * @{ */
233 /**
234 *****************************************************************************************
235 * @brief Function for initializing the DFU Used and Program State Callback.
236 *
237 * @note When APP wants to add DFU features, the flash_read and flash_write functions should be registered.
238 * To creat own DFU bootloaders, all functions in dfu_func_t should be registered. In order to show
239 * DFU program states by own DFU bootloaders, all functions in @ref dfu_pro_callback_t should be registered.
240 *
241 * @param[in] p_app_dfu_func: DFU used functions.
242 * @param[in] p_dfu_buffer: DFU data receiving buffer.
243 * @param[in] p_dfu_callback: DFU program state callback functions.
244 *****************************************************************************************
245 */
246 void dfu_init(dfu_func_t *p_app_dfu_func, uint8_t* p_dfu_buffer, dfu_pro_callback_t *p_dfu_callback);
247
248 /**
249 *****************************************************************************************
250 * @brief Function for reset the DFU cmd parse state.
251 *
252 * @note When APP wants to add DFU timeout feature, shoulde reset DFU cmd parse state when timeout.
253 *****************************************************************************************
254 */
255 void dfu_cmd_parse_state_reset(void);
256
257 /**
258 *****************************************************************************************
259 * @brief Function for setting the BLE MTU size.
260 *
261 * @note If the user wants to create his or her own DFU bootloader, the DFU MTU size should be
262 * set by using this function (when the MTU size is updated, this function should be called).
263 *
264 * @param[in] mtu_size: The BLE MTU size.
265 *****************************************************************************************
266 */
267 void dfu_ble_set_mtu_size(uint16_t mtu_size);
268
269 /**
270 *****************************************************************************************
271 * @brief This function should be called when BLE stack sends data completely.
272 *
273 * @note This function should be used when the user wants to create his or her own DFU bootloader.
274 *
275 * @retval void
276 *****************************************************************************************
277 */
278 void dfu_ble_send_data_cmpl_process(void);
279
280 /**
281 *****************************************************************************************
282 * @brief This function should be called when BLE receives data.
283 *
284 * @note This function should be used when the user wants to create his or her own DFU bootloader.
285 *
286 * @param[in] p_data: The received data from BLE.
287 * @param[in] length: The length of data.
288 *****************************************************************************************
289 */
290 void dfu_ble_receive_data_process(uint8_t *p_data, uint16_t length);
291
292 /**
293 *****************************************************************************************
294 * @brief This function should be called when UART receives data.
295 *
296 * @note This function should be used when the user wants to create his or her own DFU bootloader.
297 *
298 * @param[in] p_data: The received data from UART
299 * @param[in] length: The length of data
300 *****************************************************************************************
301 */
302 void dfu_uart_receive_data_process(uint8_t *p_data, uint16_t length);
303
304 /**
305 *****************************************************************************************
306 * @brief Function for checking DFU cmd.
307 *
308 * @note This function should be called in main loop.
309 *****************************************************************************************
310 */
311 void dfu_schedule(void);
312
313 /**
314 *****************************************************************************************
315 * @brief Function for jumping to address to run.
316 *
317 * @note In Apps, if the user wants to jump to another APP or own a DFU bootloader and run the code,
318 * this function can be called. This function does not change the boot info, so the original APP will run after resetting.
319 *
320 * @param[in] start_addr: The jumped address.
321 *****************************************************************************************
322 */
323 void dfu_start_jump(uint32_t start_addr);
324
325 /**
326 *****************************************************************************************
327 * @brief Function for changing the boot info and reseting device.
328 *
329 * @note In Apps, if the user wants to jump to another APP or own a DFU bootloader and run the code,
330 * this function can be called (the boot info will be changed).
331 *
332 * @param[in] p_boot_info: The boot info of the APP you want to run.
333 *****************************************************************************************
334 */
335 void dfu_start_address(boot_info_t *p_boot_info);
336
337 /**
338 *****************************************************************************************
339 * @brief Function for set DFU disable cmd.
340 *
341 * @note In Apps, if the user wants to jump to ROM DFU run,but want to be able to control the operation permissions of DFU,
342 * this function can be called.
343 *
344 * @param[in] disable_cmd_bit_map: The bitmask of DFU disable cmd See @ref DFU_CMD_DISABLE.
345 *****************************************************************************************
346 */
347 void dfu_set_disable_cmd(uint16_t disable_cmd_bit_map);
348
349 /**
350 *****************************************************************************************
351 * @brief Function for initializing the DFU SPI Flash Callback.
352 *
353 * @note When APP wants to add DFU operationally external flash feature, the dfu_spi_flash_func_t should be registered.
354 *
355 * @param[in] spi_flash_func: DFU operationally external flash used functions.
356 *****************************************************************************************
357 */
358 void dfu_spi_flash_func_config(dfu_spi_flash_func_t *spi_flash_func);
359
360 /** @} */
361 #endif
362 /** @} */
363 /** @} */
dfu_uart_info_t::pin_group
dfu_uart_pin_group_t pin_group
Uart pin group.
Definition: gr55xx_dfu.h:167
dfu_init
void dfu_init(dfu_func_t *p_app_dfu_func, uint8_t *p_dfu_buffer, dfu_pro_callback_t *p_dfu_callback)
Function for initializing the DFU Used and Program State Callback.
DFU_ADV_MAX_LENGTH
#define DFU_ADV_MAX_LENGTH
The max length of advertisement is 18 bytes.
Definition: gr55xx_dfu.h:56
dfu_set_disable_cmd
void dfu_set_disable_cmd(uint16_t disable_cmd_bit_map)
Function for set DFU disable cmd.
boot_info_t::load_addr
uint32_t load_addr
Firmware Load Address.
Definition: gr55xx_dfu.h:145
boot_info_t::code_copy_mode
uint32_t code_copy_mode
Bit: 4 code copy mode.
Definition: gr55xx_dfu.h:150
DFU_UART_PARITY_ODD
@ DFU_UART_PARITY_ODD
Parity odd.
Definition: gr55xx_dfu.h:111
dfu_func_t
DFU used functions config definition.
Definition: gr55xx_dfu.h:196
dfu_ble_receive_data_process
void dfu_ble_receive_data_process(uint8_t *p_data, uint16_t length)
This function should be called when BLE receives data.
DFU_UART_STOP_BIT_1_5
@ DFU_UART_STOP_BIT_1_5
Stop bit 1.5.
Definition: gr55xx_dfu.h:103
DFU_UART_PIN_GROUP_0
@ DFU_UART_PIN_GROUP_0
GPIO0_PIN3 -> UART0_TXD(MUX0),GPIO0_PIN4 -> UART0_RXD(MUX0)
Definition: gr55xx_dfu.h:120
dfu_uart_info_t
DFU uart config definition.
Definition: gr55xx_dfu.h:161
DFU_UART_BAUDRATE_9600
@ DFU_UART_BAUDRATE_9600
Baudrate 9600.
Definition: gr55xx_dfu.h:81
DFU_UART_PIN_GROUP_3
@ DFU_UART_PIN_GROUP_3
GPIO1_PIN14 -> UART0_TXD(MUX5),GPIO1_PIN10 -> UART0_RXD(MUX5)
Definition: gr55xx_dfu.h:123
dfu_uart_receive_data_process
void dfu_uart_receive_data_process(uint8_t *p_data, uint16_t length)
This function should be called when UART receives data.
dfu_start_jump
void dfu_start_jump(uint32_t start_addr)
Function for jumping to address to run.
DFU_UART_DATA_BIT_5
@ DFU_UART_DATA_BIT_5
Data bit 5.
Definition: gr55xx_dfu.h:93
dfu_nvds_info_t
DFU NVDS init info definition.
Definition: gr55xx_dfu.h:180
dfu_uart_info_t::parity
dfu_uart_parity_bit_t parity
Specify the parity mode.
Definition: gr55xx_dfu.h:166
DFU_UART_PARITY_SP_1
@ DFU_UART_PARITY_SP_1
Parity stick 1.
Definition: gr55xx_dfu.h:114
dfu_uart_info_t::data_bit
dfu_uart_data_bit_t data_bit
The number of data bits transmitted or received in a frame.
Definition: gr55xx_dfu.h:164
boot_info_t::xqspi_speed
uint32_t xqspi_speed
Bit: 0-3 clock speed.
Definition: gr55xx_dfu.h:149
boot_info_t::boot_delay
uint32_t boot_delay
Bit: Boot delay flag.
Definition: gr55xx_dfu.h:153
dfu_ble_set_mtu_size
void dfu_ble_set_mtu_size(uint16_t mtu_size)
Function for setting the BLE MTU size.
DFU_UART_BAUDRATE_921600
@ DFU_UART_BAUDRATE_921600
Baudrate 921600.
Definition: gr55xx_dfu.h:87
dfu_ble_send_data_cmpl_process
void dfu_ble_send_data_cmpl_process(void)
This function should be called when BLE stack sends data completely.
boot_info_t::bin_size
uint32_t bin_size
Firmware Size.
Definition: gr55xx_dfu.h:143
DFU_UART_PARITY_SP_0
@ DFU_UART_PARITY_SP_0
Parity stick 0.
Definition: gr55xx_dfu.h:113
dfu_uart_stop_bit_t
dfu_uart_stop_bit_t
UART stop bit definition.
Definition: gr55xx_dfu.h:101
dfu_uart_parity_bit_t
dfu_uart_parity_bit_t
UART parity definition.
Definition: gr55xx_dfu.h:109
DFU_UART_BAUDRATE_230400
@ DFU_UART_BAUDRATE_230400
Baudrate 230400.
Definition: gr55xx_dfu.h:86
DFU_UART_BAUDRATE_19200
@ DFU_UART_BAUDRATE_19200
Baudrate 19200.
Definition: gr55xx_dfu.h:82
dfu_cmd_disable_t::state
dfu_info_state state
If DFU cmd disable config is required, this parameter can be a value of dfu_info_state.
Definition: gr55xx_dfu.h:189
dfu_uart_info_t::stop_bits
dfu_uart_stop_bit_t stop_bits
The number of stop bits transmitted.
Definition: gr55xx_dfu.h:165
DFU_UART_STOP_BIT_1
@ DFU_UART_STOP_BIT_1
Stop bit 1.
Definition: gr55xx_dfu.h:102
dfu_info_state
dfu_info_state
DFU informatica status.
Definition: gr55xx_dfu.h:130
DFU_INFO_DISABLE
@ DFU_INFO_DISABLE
DFU Config Info Disable.
Definition: gr55xx_dfu.h:131
dfu_schedule
void dfu_schedule(void)
Function for checking DFU cmd.
dfu_uart_info_t::state
dfu_info_state state
DFU UART Enable or Disable.
Definition: gr55xx_dfu.h:162
DFU_UART_BAUDRATE_115200
@ DFU_UART_BAUDRATE_115200
Baudrate 115200.
Definition: gr55xx_dfu.h:85
dfu_nvds_info_t::page_size
uint16_t page_size
NVDS page size.
Definition: gr55xx_dfu.h:182
DFU_UART_DATA_BIT_7
@ DFU_UART_DATA_BIT_7
Data bit 7.
Definition: gr55xx_dfu.h:95
DFU_UART_PIN_GROUP_2
@ DFU_UART_PIN_GROUP_2
GPIO0_PIN0 -> UART0_TXD(MUX4),GPIO0_PIN1 -> UART0_RXD(MUX4)
Definition: gr55xx_dfu.h:122
boot_info_t::run_addr
uint32_t run_addr
Firmware Run Address.
Definition: gr55xx_dfu.h:146
DFU_INFO_DEFAULT
@ DFU_INFO_DEFAULT
DFU Config Info DEFAULT.
Definition: gr55xx_dfu.h:133
DFU_UART_BAUDRATE_38400
@ DFU_UART_BAUDRATE_38400
Baudrate 38400.
Definition: gr55xx_dfu.h:83
dfu_start_address
void dfu_start_address(boot_info_t *p_boot_info)
Function for changing the boot info and reseting device.
dfu_uart_pin_group_t
dfu_uart_pin_group_t
UART pin group definition.
Definition: gr55xx_dfu.h:119
boot_info_t::check_sum
uint32_t check_sum
Firmware Check Sum Value.
Definition: gr55xx_dfu.h:144
DFU_UART_PIN_GROUP_1
@ DFU_UART_PIN_GROUP_1
GPIO0_PIN10 -> UART0_TXD(MUX2),GPIO0_PIN11 -> UART0_RXD(MUX2)
Definition: gr55xx_dfu.h:121
dfu_adv_name_info_t::adv_name_length
uint16_t adv_name_length
The length of the name.
Definition: gr55xx_dfu.h:175
dfu_uart_data_bit_t
dfu_uart_data_bit_t
UART data bit definition.
Definition: gr55xx_dfu.h:92
dfu_adv_name_info_t::state
dfu_info_state state
If a set name is used, this parameter can be a value of dfu_info_state.
Definition: gr55xx_dfu.h:173
DFU_UART_PARITY_EVEN
@ DFU_UART_PARITY_EVEN
Parity even.
Definition: gr55xx_dfu.h:112
dfu_uart_baudrate_t
dfu_uart_baudrate_t
UART baudrate definition.
Definition: gr55xx_dfu.h:80
dfu_spi_flash_func_config
void dfu_spi_flash_func_config(dfu_spi_flash_func_t *spi_flash_func)
Function for initializing the DFU SPI Flash Callback.
dfu_uart_info_t::baud_rate
dfu_uart_baudrate_t baud_rate
UART communication baudrate.
Definition: gr55xx_dfu.h:163
dfu_cmd_disable_t::cmd_bit_map
uint16_t cmd_bit_map
NVDS start address.
Definition: gr55xx_dfu.h:190
DFU_UART_DATA_BIT_6
@ DFU_UART_DATA_BIT_6
Data bit 6.
Definition: gr55xx_dfu.h:94
boot_info_t
BootLoader information definition.
Definition: gr55xx_dfu.h:142
DFU_UART_STOP_BIT_2
@ DFU_UART_STOP_BIT_2
Stop bit 2.
Definition: gr55xx_dfu.h:104
boot_info_t::check_image
uint32_t check_image
Bit: 8 check image.
Definition: gr55xx_dfu.h:152
dfu_nvds_info_t::start_address
uint32_t start_address
NVDS start address.
Definition: gr55xx_dfu.h:183
dfu_adv_name_info_t
DFU Advertisement name config definition.
Definition: gr55xx_dfu.h:172
boot_info_t::xqspi_xip_cmd
uint32_t xqspi_xip_cmd
XIP Read Mode.
Definition: gr55xx_dfu.h:147
dfu_spi_flash_func_t
SPI used functions config definition.
Definition: gr55xx_dfu.h:210
DFU_UART_BAUDRATE_57600
@ DFU_UART_BAUDRATE_57600
Baudrate 57600.
Definition: gr55xx_dfu.h:84
boot_info_t::is_dap_boot
uint32_t is_dap_boot
Bit: 11 check if boot dap mode.
Definition: gr55xx_dfu.h:154
boot_info_t::system_clk
uint32_t system_clk
Bit: 5-7 system clock.
Definition: gr55xx_dfu.h:151
dfu_pro_callback_t
DFU program state callback definition.
Definition: gr55xx_dfu.h:222
dfu_nvds_info_t::state
dfu_info_state state
If NVDS init is required, this parameter can be a value of dfu_info_state.
Definition: gr55xx_dfu.h:181
dfu_cmd_parse_state_reset
void dfu_cmd_parse_state_reset(void)
Function for reset the DFU cmd parse state.
DFU_UART_PARITY_NONE
@ DFU_UART_PARITY_NONE
Parity none.
Definition: gr55xx_dfu.h:110
DFU_UART_PIN_GROUP_5
@ DFU_UART_PIN_GROUP_5
GPIO0_PIN9 -> UART1_TXD(MUX3),GPIO0_PIN8 -> UART1_RXD(MUX3)
Definition: gr55xx_dfu.h:125
DFU_INFO_ENABLE
@ DFU_INFO_ENABLE
DFU Config Info Enable.
Definition: gr55xx_dfu.h:132
dfu_cmd_disable_t
DFU cmd disable info definition.
Definition: gr55xx_dfu.h:188
DFU_UART_DATA_BIT_8
@ DFU_UART_DATA_BIT_8
Data bit 8.
Definition: gr55xx_dfu.h:96
boot_info_t::reserved
uint32_t reserved
Bit: 24 reserved.
Definition: gr55xx_dfu.h:155
DFU_UART_PIN_GROUP_4
@ DFU_UART_PIN_GROUP_4
GPIO0_PIN7 -> UART1_TXD(MUX3),GPIO0_PIN6 -> UART1_RXD(MUX3)
Definition: gr55xx_dfu.h:124