Microchip® Advanced Software Framework

uart_dfu.c File Reference
#include <avr32/io.h>
#include <stddef.h>
#include <string.h>
#include "compiler.h"
#include "board.h"
#include "conf_uart.h"
#include "conf_clocks.h"
#include "gpio.h"
#include "intc.h"
#include "usart.h"
#include "power_clocks_lib.h"
#include "flash_api.h"
#include "uart_dfu.h"
#include "boot.h"
#include "conf_isp.h"
#include "isp.h"

Macros

#define CMD_BLANK_CHECK   0x01
 
#define CMD_ERASE   0x00
 
#define CMD_ERASE_ARG_CHIP   0xFF
 
#define CMD_GRP_DATA   0x00
 
#define CMD_GRP_DNLOAD   0x01
 
#define CMD_GRP_EXEC   0x04
 
#define CMD_GRP_SELECT   0x06
 
#define CMD_GRP_UPLOAD   0x03
 
#define CMD_PROGRAM_START   0x00
 
#define CMD_READ_MEMORY   0x00
 
#define CMD_SELECT_MEMORY   0x03
 
#define CMD_SELECT_MEMORY_ARG_PAGE   0x01
 
#define CMD_SELECT_MEMORY_ARG_UNIT   0x00
 
#define CMD_START_APPLI   0x03
 
#define CMD_START_APPLI_ARG_NO_RESET   0x01
 
#define CMD_START_APPLI_ARG_RESET   0x00
 
#define DFU_ANSWER_CHKSUM_ERR   'X'
 
#define DFU_ANSWER_END_CHAR1   '\r'
 
#define DFU_ANSWER_END_CHAR2   '\n'
 
#define DFU_ANSWER_EQUAL   '='
 
#define DFU_ANSWER_OK   '.'
 
#define DFU_ANSWER_RW_ERROR_SECURITY_SET   'L'
 
#define DFU_ANSWER_UNKNOWN   'K'
 Answer codes. More...
 
#define DFU_ANSWER_WRITE_ERROR   'P'
 
#define DFU_CMD_STATUS_errADDRESS   0x8
 
#define DFU_CMD_STATUS_errBLANKCHECK   0x80
 
#define DFU_CMD_STATUS_errCHECKSUM   0x20
 
#define DFU_CMD_STATUS_errSECURITY_SET   0x2
 
#define DFU_CMD_STATUS_errUNEXPECTED   0x40
 
#define DFU_CMD_STATUS_errUNKNOWN   0x4
 
#define DFU_CMD_STATUS_errWRITE   0x10
 
#define DFU_CMD_STATUS_OK   0x1
 
#define DFU_CMD_STATUS_OK_NORETCHAR   0x0
 
#define DFU_PACKET_START_CHAR   ':'
 
#define DFU_STATE_IDLE   0
 
#define DFU_STATE_PROGRAM   1
 
#define DFU_SYNCHRO_CHAR   'U'
 
#define INTELHEX_MAX_DATA_LENGTH   0xFFu
 
#define ISP_ID0_ADDRESS   0x01
 
#define ISP_ID1_ADDRESS   0x02
 
#define ISP_INF_ITEM_COUNT   (ISP_ID1_ADDRESS + 1)
 
#define ISP_VERSION_ADDRESS   0x00
 
#define MEM_BOOTLOADER   0x04
 
#define MEM_CONFIGURATION   0x03
 
#define MEM_COUNT   (MEM_INTRAM + 1)
 
#define MEM_EEPROM   0x01
 
#define MEM_FLASH   0x00
 
#define MEM_INTRAM   0x07
 
#define MEM_SECURITY   0x02
 
#define MEM_SIGNATURE   0x05
 
#define MEM_USER   0x06
 
#define POLYNOMIAL   (ISP_CFG1_CRC8_POLYNOMIAL << 7)
 Calculates the CRC-8-CCITT. More...
 
#define PRODUCT_INF_ITEM_COUNT   (PRODUCT_REVISION_ADDRESS + 1)
 
#define PRODUCT_MANUFACTURER_ID_ADDRESS   0x00
 
#define PRODUCT_PART_NUMBER_LSB_ADDRESS   0x02
 
#define PRODUCT_PART_NUMBER_MSB_ADDRESS   0x01
 
#define PRODUCT_REVISION_ADDRESS   0x03
 
#define UART_RX_BUFFER_SIZE   32
 

Functions

void _unhandled_interrupt (void)
 Default interrupt handler. More...
 
static U8 conv_ascii_to_hex (U8 *ascii)
 convert an ascii 2-byte data into a 1-byte hexdecimal value. More...
 
static U8 Crc8 (U8 inCrc, U8 inData)
 
static void dump_dfu_packet (U8 data_nb_Bytes_left)
 
static void dump_dfu_packet_and_reset_dfu_state (U8 data_nb_Bytes_left)
 
static void erase_check_mem (void)
 Read n Bytes from the currently chosen memory and verify that each. More...
 
static void force_isp (bool force)
 
static U8 get_and_check_mem_range_and_crc (req_header_t *req_header, U8 *checksum)
 Read and check the start address and the end address. Validate the checksum. More...
 
static bool is_isp_forced (void)
 
static void mem_bootloader_read (void *dst, U32 src, size_t nbytes)
 Read the bootloader memory (i.e. the ISP version info) More...
 
static void mem_configuration_read (void *dst, U32 src, size_t nbytes)
 Read nbytes GP fuse bit, copy each bit to a Byte. More...
 
static int mem_configuration_write (U32 dst, const void *src, size_t nbytes)
 Write nbytes GP fuse bit (one Byte per bit) More...
 
static void mem_flash_read (void *dst, U32 src, size_t nbytes)
 Read n Bytes from the internal Flash memory at address src and copy at address dst. More...
 
static int mem_flash_write (U32 dst, const void *src, size_t nbytes)
 Write n Bytes from src to the internal Flash memory address dst. More...
 
static void mem_intram_read (void *dst, U32 src, size_t nbytes)
 Read n Bytes from the internal page address src and copy to the address dst. More...
 
static void mem_security_read (void *dst, U32 src, size_t nbytes)
 Write the value 1 to *dst if the security bit is set, else write 0. More...
 
static int mem_security_write (U32 dst, const void *src, size_t nbytes)
 Set the security bit. More...
 
static void mem_signature_read (void *dst, U32 src, size_t nbytes)
 Read the signature memory (i.e. the UC3 device info) More...
 
static void mem_user_read (void *dst, U32 src, size_t nbytes)
 Read n Bytes from the user page address src and copy to the address dst. More...
 
static int mem_user_write (U32 dst, const void *src, size_t nbytes)
 Write n Bytes from src to the user page address dst. More...
 
static void parse_dfu_intel_hex_header (req_header_t *req_header, U8 *intel_hex_req_header, U8 *checksum)
 Parse a DFU Intel hex string and store info into a structure. This parser parses only the first 9 bytes of this structure (including the ':' character). More...
 
void process_cmd_grp_data (req_header_t *req_header, U8 *checksum)
 Process commands under the CMD_GRP_DATA type. More...
 
void process_cmd_grp_dnload (req_header_t *req_header, U8 *checksum)
 Process commands under the CMD_GRP_DOWNLOAD type. More...
 
void process_cmd_grp_exec (req_header_t *req_header, U8 *checksum)
 Process commands under the CMD_GRP_EXEC type. More...
 
void process_cmd_grp_select (req_header_t *req_header, U8 *checksum)
 Process commands under the CMD_GRP_SELECT type. More...
 
void process_cmd_grp_upload (req_header_t *req_header, U8 *checksum)
 Process commands under the CMD_GRP_UPLOAD type. More...
 
static void read_mem (void)
 Read address_range_nb_bytes Bytes from the currently selected memory. More...
 
static void send_answer_frame (void)
 Build and send the answer frame. More...
 
static void stop_dfu_and_reset (int forceisp)
 
static int uart_autobaud_process (void)
 Perform the UART autobaud process by using the synchronizer character sent by the external programmer. More...
 
static void uart_configure (void)
 function used to configure the 4 potential USART candidates with the current PBA frequency. More...
 
static void uart_convert16bit2ascii_write (U16 u16_val)
 Convert and write on the USART a 2-byte value into a 4 characters ascii string. More...
 
static void uart_convertbyte2ascii_write (U8 *pdfu_buffer, int nb_bytes)
 Convert each Byte of a input buffer into a hexadecimal 2-ascii-character string and write each digit to the UART. More...
 
static void uart_dfu_read_char (U8 *data)
 UART DFU read function (read + echo) More...
 
void uart_dfu_start (void)
 Configure the USART, initialize the DFU and setup/calculate the autobaud. More...
 
static void uart_dfu_stop (int forceisp)
 
void uart_execute_dfu_command (req_header_t *req_header, U8 *checksum)
 Execute the DFU command required by the external programmer tool. More...
 
U8 uart_get_dfu_command (req_header_t *req_header)
 Get the DFU command from the external programmer tool. More...
 
static U16 uart_read_16bits (U8 *checksum)
 
static U8 uart_read_Byte (U8 *checksum)
 
static U8 validate_checksum (U8 *checksum)
 Validate the checksum with the one read on the USART. More...
 
static void vUSART_ISR (void)
 
static void vUSART_ISR_init (void)
 
static void write_mem (req_header_t *req_header, U8 *checksum)
 Receive the data from one intel-Hex frame and program the data to the. More...
 

Variables

static U32 address_range_nb_bytes
 
static U16 current_page = 0
 
static U8 dfu_buffer [DFU_BUFFER_LENGTH]
 
static U32 dfu_buffer_nb_Bytes
 
static U8 dfu_state = DFU_STATE_IDLE
 
static U8 dfu_status = DFU_CMD_STATUS_OK
 
static volatile avr32_usart_t * DFU_USART
 
static volatile avr32_usart_t * DFU_USART_CANDIDATES []
 
static int DFU_USART_IRQS []
 
static address_t end_address
 
static int flag_checksum_read
 
static const U8 ISP_INF [ISP_INF_ITEM_COUNT]
 
static U8 memory = MEM_FLASH
 
struct {
   void(*   read )(void *dst, U32 src, size_t
      nbytes)
 
   int(*   write )(U32 dst, const void *src,
      size_t nbytes)
 
MEMORY_ACCESS [MEM_COUNT]
 
static address_t MEMORY_END_ADDRESS [MEM_COUNT]
 
static const U8 MEMORY_ERASE_VALUE [MEM_COUNT]
 
static U8 PRODUCT_INF [PRODUCT_INF_ITEM_COUNT]
 
static U8ptr_dfu_buffer
 
static volatile U8 rx_buffer [UART_RX_BUFFER_SIZE]
 
static volatile U32 rx_read_idx
 
static volatile U32 rx_write_idx
 
static bool security_active = true
 
static address_t start_address
 
static const gpio_map_t USART_RX_GPIO_MAP
 
static const gpio_map_t USART_TX_GPIO_MAP
 

#define CMD_BLANK_CHECK   0x01

Referenced by process_cmd_grp_upload().

#define CMD_ERASE   0x00

Referenced by process_cmd_grp_exec().

#define CMD_ERASE_ARG_CHIP   0xFF

Referenced by process_cmd_grp_exec().

#define CMD_GRP_DATA   0x00
#define CMD_GRP_DNLOAD   0x01
#define CMD_GRP_EXEC   0x04
#define CMD_GRP_SELECT   0x06
#define CMD_GRP_UPLOAD   0x03
#define CMD_PROGRAM_START   0x00

Referenced by process_cmd_grp_dnload().

#define CMD_READ_MEMORY   0x00

Referenced by process_cmd_grp_upload().

#define CMD_SELECT_MEMORY   0x03

Referenced by process_cmd_grp_select().

#define CMD_SELECT_MEMORY_ARG_PAGE   0x01

Referenced by process_cmd_grp_select().

#define CMD_SELECT_MEMORY_ARG_UNIT   0x00

Referenced by process_cmd_grp_select().

#define CMD_START_APPLI   0x03

Referenced by process_cmd_grp_exec().

#define CMD_START_APPLI_ARG_NO_RESET   0x01

Referenced by process_cmd_grp_exec().

#define CMD_START_APPLI_ARG_RESET   0x00

Referenced by process_cmd_grp_exec().

#define DFU_ANSWER_CHKSUM_ERR   'X'

Referenced by send_answer_frame().

#define DFU_ANSWER_END_CHAR1   '\r'

Referenced by read_mem(), and send_answer_frame().

#define DFU_ANSWER_END_CHAR2   '\n'

Referenced by read_mem(), and send_answer_frame().

#define DFU_ANSWER_EQUAL   '='

Referenced by read_mem().

#define DFU_ANSWER_OK   '.'

Referenced by send_answer_frame().

#define DFU_ANSWER_RW_ERROR_SECURITY_SET   'L'

Referenced by send_answer_frame().

#define DFU_ANSWER_UNKNOWN   'K'

Answer codes.

Referenced by send_answer_frame().

#define DFU_ANSWER_WRITE_ERROR   'P'

Referenced by send_answer_frame().

#define DFU_CMD_STATUS_errADDRESS   0x8
#define DFU_CMD_STATUS_errBLANKCHECK   0x80
#define DFU_CMD_STATUS_errSECURITY_SET   0x2
#define DFU_CMD_STATUS_errUNEXPECTED   0x40
#define DFU_CMD_STATUS_errWRITE   0x10
#define DFU_CMD_STATUS_OK   0x1
#define DFU_CMD_STATUS_OK_NORETCHAR   0x0

Referenced by process_cmd_grp_upload().

#define DFU_PACKET_START_CHAR   ':'

Referenced by uart_get_dfu_command().

#define DFU_STATE_IDLE   0
#define DFU_STATE_PROGRAM   1
#define DFU_SYNCHRO_CHAR   'U'
#define INTELHEX_MAX_DATA_LENGTH   0xFFu

Referenced by write_mem().

#define ISP_ID0_ADDRESS   0x01
#define ISP_ID1_ADDRESS   0x02
#define ISP_INF_ITEM_COUNT   (ISP_ID1_ADDRESS + 1)
#define ISP_VERSION_ADDRESS   0x00
#define MEM_BOOTLOADER   0x04

Referenced by process_cmd_grp_select().

#define MEM_CONFIGURATION   0x03

Referenced by process_cmd_grp_select().

#define MEM_COUNT   (MEM_INTRAM + 1)
#define MEM_EEPROM   0x01
#define MEM_INTRAM   0x07
#define MEM_SECURITY   0x02

Referenced by process_cmd_grp_select().

#define MEM_SIGNATURE   0x05

Referenced by process_cmd_grp_select().

#define MEM_USER   0x06
#define POLYNOMIAL   (ISP_CFG1_CRC8_POLYNOMIAL << 7)

Calculates the CRC-8-CCITT.

CRC-8-CCITT is defined to be x^8 + x^2 + x + 1

To use this function use the following template:

crc = Crc8( crc, data );

Referenced by Crc8().

#define PRODUCT_INF_ITEM_COUNT   (PRODUCT_REVISION_ADDRESS + 1)
#define PRODUCT_MANUFACTURER_ID_ADDRESS   0x00

Referenced by uart_dfu_start().

#define PRODUCT_PART_NUMBER_LSB_ADDRESS   0x02

Referenced by uart_dfu_start().

#define PRODUCT_PART_NUMBER_MSB_ADDRESS   0x01

Referenced by uart_dfu_start().

#define PRODUCT_REVISION_ADDRESS   0x03

Referenced by uart_dfu_start().

#define UART_RX_BUFFER_SIZE   32

void _unhandled_interrupt ( void  )

Default interrupt handler.

Note
Taken and adapted from Newlib.

Referenced by INTC_init_interrupts(), uart_dfu_stop(), and vUSART_ISR_init().

static U8 conv_ascii_to_hex ( U8 ascii)
static

convert an ascii 2-byte data into a 1-byte hexdecimal value.

Parameters
asciia pointer on the 2-byte data to convert.
Returns
It returns the value of the ascii data in hexacimal.

References i, and temp.

Referenced by parse_dfu_intel_hex_header(), and uart_read_Byte().

static U8 Crc8 ( U8  inCrc,
U8  inData 
)
static

References data, i, and POLYNOMIAL.

Referenced by force_isp().

static void dump_dfu_packet ( U8  data_nb_Bytes_left)
static
static void dump_dfu_packet_and_reset_dfu_state ( U8  data_nb_Bytes_left)
static
static void erase_check_mem ( void  )
static

Read n Bytes from the currently chosen memory and verify that each.

References dfu_buffer, DFU_BUFFER_LENGTH_READ, DFU_CMD_STATUS_errBLANKCHECK, address_t::long_address, memory, MEMORY_ACCESS, and min.

Referenced by process_cmd_grp_upload().

static U8 get_and_check_mem_range_and_crc ( req_header_t req_header,
U8 checksum 
)
static

Read and check the start address and the end address. Validate the checksum.

Parameters
req_headerpointer on a structure containing the frame header information
checksumA pointer on a 8-bit value that contains the actual checksum.
Returns
0 if the start and end addresses are correct and if the checksum is OK. Additionally if the start address and/or end address are/is wrong, the dfu_status global variable is set to DFU_CMD_STATUS_errADDRESS.

References current_page, DFU_CMD_STATUS_errADDRESS, FAIL, req_header_t::length, address_t::long_address, address_t::page, address_t::page_offset, uart_read_16bits(), and validate_checksum().

Referenced by process_cmd_grp_dnload(), and process_cmd_grp_upload().

static bool is_isp_forced ( void  )
static
static void mem_bootloader_read ( void *  dst,
U32  src,
size_t  nbytes 
)
static

Read the bootloader memory (i.e. the ISP version info)

static void mem_configuration_read ( void *  dst,
U32  src,
size_t  nbytes 
)
static

Read nbytes GP fuse bit, copy each bit to a Byte.

static int mem_configuration_write ( U32  dst,
const void *  src,
size_t  nbytes 
)
static

Write nbytes GP fuse bit (one Byte per bit)

References FAIL, and PASS.

static void mem_flash_read ( void *  dst,
U32  src,
size_t  nbytes 
)
static

Read n Bytes from the internal Flash memory at address src and copy at address dst.

static int mem_flash_write ( U32  dst,
const void *  src,
size_t  nbytes 
)
static

Write n Bytes from src to the internal Flash memory address dst.

References FAIL, and PASS.

static void mem_intram_read ( void *  dst,
U32  src,
size_t  nbytes 
)
static

Read n Bytes from the internal page address src and copy to the address dst.

static void mem_security_read ( void *  dst,
U32  src,
size_t  nbytes 
)
static

Write the value 1 to *dst if the security bit is set, else write 0.

static int mem_security_write ( U32  dst,
const void *  src,
size_t  nbytes 
)
static

Set the security bit.

References FAIL, and PASS.

static void mem_signature_read ( void *  dst,
U32  src,
size_t  nbytes 
)
static

Read the signature memory (i.e. the UC3 device info)

static void mem_user_read ( void *  dst,
U32  src,
size_t  nbytes 
)
static

Read n Bytes from the user page address src and copy to the address dst.

static int mem_user_write ( U32  dst,
const void *  src,
size_t  nbytes 
)
static

Write n Bytes from src to the user page address dst.

References FAIL, and PASS.

Referenced by force_isp().

static void parse_dfu_intel_hex_header ( req_header_t req_header,
U8 intel_hex_req_header,
U8 checksum 
)
static

Parse a DFU Intel hex string and store info into a structure. This parser parses only the first 9 bytes of this structure (including the ':' character).

Parameters
req_headerThe structure where the formatted info will be stored.
intel_hex_req_headerThe raw Intel Hex header frame (a pointer on the first 9 bytes).
checksumA pointer on a 8-bit value used to contain the checksum of the header frame.

References req_header_t::address, conv_ascii_to_hex(), current_page, req_header_t::length, address_t::page, address_t::page_offset, and req_header_t::type.

Referenced by uart_get_dfu_command().

void process_cmd_grp_data ( req_header_t req_header,
U8 checksum 
)
static void stop_dfu_and_reset ( int  forceisp)
static
static int uart_autobaud_process ( void  )
static

Perform the UART autobaud process by using the synchronizer character sent by the external programmer.

References DFU_SYNCHRO_CHAR, FAIL, PASS, SLEEP, and usart_bw_write_char().

Referenced by uart_dfu_start().

static void uart_convert16bit2ascii_write ( U16  u16_val)
static

Convert and write on the USART a 2-byte value into a 4 characters ascii string.

Parameters
u16_valthe 2-byte value to process.

References data, i, temp, and usart_bw_write_char().

Referenced by read_mem(), and send_answer_frame().

static void uart_convertbyte2ascii_write ( U8 pdfu_buffer,
int  nb_bytes 
)
static

Convert each Byte of a input buffer into a hexadecimal 2-ascii-character string and write each digit to the UART.

Parameters
pdfu_bufferbuffer of Bytes
nb_bytesnumber of Bytes in dfu_buffer[]

References temp, and usart_bw_write_char().

Referenced by read_mem().

static void uart_dfu_read_char ( U8 data)
inlinestatic

UART DFU read function (read + echo)

Parameters
dataa pointer on an unsigned 8-bit data which will contain the data read.

References SLEEP, UART_RX_BUFFER_SIZE, and usart_bw_write_char().

Referenced by uart_get_dfu_command(), and uart_read_Byte().

U8 uart_get_dfu_command ( req_header_t req_header)

Get the DFU command from the external programmer tool.

References DFU_PACKET_START_CHAR, i, parse_dfu_intel_hex_header(), and uart_dfu_read_char().

Referenced by main().

static U16 uart_read_16bits ( U8 checksum)
static
static U8 validate_checksum ( U8 checksum)
static

Validate the checksum with the one read on the USART.

Parameters
checksumA pointer on a 8-bit value that contains the actual checksum.
Returns
0 if the checksum is OK

References uart_read_Byte().

Referenced by get_and_check_mem_range_and_crc(), process_cmd_grp_exec(), process_cmd_grp_select(), and write_mem().

static void vUSART_ISR ( void  )
static

U32 address_range_nb_bytes
static
U16 current_page = 0
static
U8 dfu_buffer[DFU_BUFFER_LENGTH]
static

Referenced by erase_check_mem().

U32 dfu_buffer_nb_Bytes
static

Referenced by write_mem().

U8 dfu_state = DFU_STATE_IDLE
static
U8 dfu_status = DFU_CMD_STATUS_OK
static
volatile avr32_usart_t* DFU_USART
static
volatile avr32_usart_t* DFU_USART_CANDIDATES[]
static
Initial value:
=
{
DFU_USART_CANDIDATE0,
DFU_USART_CANDIDATE1,
DFU_USART_CANDIDATE2,
DFU_USART_CANDIDATE3
}

Referenced by uart_configure(), uart_dfu_stop(), and vUSART_ISR_init().

int DFU_USART_IRQS[]
static
Initial value:
=
{
DFU_USART_CANDIDATE0_IRQ,
DFU_USART_CANDIDATE1_IRQ,
DFU_USART_CANDIDATE2_IRQ,
DFU_USART_CANDIDATE3_IRQ
}

Referenced by vUSART_ISR_init().

address_t end_address
static
int flag_checksum_read
static
const U8 ISP_INF[ISP_INF_ITEM_COUNT]
static
Initial value:
=
{
}
#define ISP_ID0
Definition: avr32/applications/uc3-uart-bootloader/conf/conf_isp.h:53
#define ISP_ID1
Definition: avr32/applications/uc3-uart-bootloader/conf/conf_isp.h:54
#define ISP_VERSION
Definition: avr32/applications/uc3-uart-bootloader/conf/conf_isp.h:52
U8 memory = MEM_FLASH
static

Referenced by erase_check_mem(), and read_mem().

address_t MEMORY_END_ADDRESS[MEM_COUNT]
static
Initial value:
=
{
{FLASH_API_FLASH_SIZE - 1},
{0},
{0},
{AVR32_FLASHC_GPF_NUM - 1},
{sizeof(ISP_INF) - 1},
{sizeof(PRODUCT_INF) - 1},
{FLASH_API_USER_PAGE_SIZE - 1},
{AVR32_SRAM_SIZE - 1}
}
static const U8 ISP_INF[ISP_INF_ITEM_COUNT]
Definition: uart_dfu.c:191
static U8 PRODUCT_INF[PRODUCT_INF_ITEM_COUNT]
Definition: uart_dfu.c:189
const U8 MEMORY_ERASE_VALUE[MEM_COUNT]
static
Initial value:
=
{
0xFF,
0xFF,
0x00,
0x01,
0x00,
0x00,
0xFF,
0x00
}
U8 PRODUCT_INF[PRODUCT_INF_ITEM_COUNT]
static
U8* ptr_dfu_buffer
static
void(* read)(void *dst, U32 src, size_t nbytes)
volatile U8 rx_buffer[UART_RX_BUFFER_SIZE]
static
volatile U32 rx_read_idx
static
volatile U32 rx_write_idx
static
bool security_active = true
static
address_t start_address
static
const gpio_map_t USART_RX_GPIO_MAP
static
Initial value:
=
{
{DFU_USART_CANDIDATE0_RX_PIN, DFU_USART_CANDIDATE0_RX_FUNCTION},
{DFU_USART_CANDIDATE1_RX_PIN, DFU_USART_CANDIDATE1_RX_FUNCTION},
{DFU_USART_CANDIDATE2_RX_PIN, DFU_USART_CANDIDATE2_RX_FUNCTION},
{DFU_USART_CANDIDATE3_RX_PIN, DFU_USART_CANDIDATE3_RX_FUNCTION},
}
const gpio_map_t USART_TX_GPIO_MAP
static
Initial value:
=
{
{DFU_USART_CANDIDATE0_TX_PIN, DFU_USART_CANDIDATE0_TX_FUNCTION},
{DFU_USART_CANDIDATE1_TX_PIN, DFU_USART_CANDIDATE1_TX_FUNCTION},
{DFU_USART_CANDIDATE2_TX_PIN, DFU_USART_CANDIDATE2_TX_FUNCTION},
{DFU_USART_CANDIDATE3_TX_PIN, DFU_USART_CANDIDATE3_TX_FUNCTION},
}
int(* write)(U32 dst, const void *src, size_t nbytes)