|
OpenBSL
v.0.1.0
|
OpenBSL internal header file. More...
#include "OpenBSL_Device.h"Go to the source code of this file.
Classes | |
| struct | OpenBSL_MemSect_t |
Macros | |
| #define | OPEN_BSL_FUNC_PROC_ERASE_IMAGE OpenBSL_ProcEraseImg |
| #define | OPEN_BSL_FUNC_PROC_DOWNLOAD_IMAGE OpenBSL_ProcDnldImg |
| #define | OPEN_BSL_FUNC_PROC_UPLOAD_IMAGE OpenBSL_ProcUpldImg |
| #define | OPEN_BSL_FUNC_PROC_CALCULATE_CHECKSUM OpenBSL_ProcCalcChksm |
| #define | OPEN_BSL_FUNC_PROC_ERASE_SEGMENT OpenBSL_ProcEraseSegment |
| #define | OPEN_BSL_FUNC_PROC_CMD_DOWNLOAD_SEGMENT OpenBSL_ProcDnldSegment |
| #define | OPEN_BSL_FUNC_PROC_UPLOAD_SEGMENT OpenBSL_ProcUpldSegment |
| #define | OPEN_BSL_FUNC_PROC_PASSWORD OpenBSL_ProcPwdCmd |
| #define | OPEN_BSL_FUNC_PROC_JUMP_TO_ADDR OpenBSL_ProcJumpToAddr |
| #define | OPEN_BSL_CMD_FUNC_TABLE |
| #define | ENTRY(cmd, func) cmd, |
| #define | OPEN_BSL_RESP_BIT_MASK (0x80) |
| #define | OPEN_BSL_ASSERT(x) if(!(x)) OpenBSL_AssertHdl(); |
| #define | BV(x) (1 << x) |
| #define | OPEN_BSL_ADDR_DATA_SIZE (sizeof(uint32_t)) |
| #define | OPEN_BSL_MAX_SEGMENT_READ_WRITE_DATA_SIZE (32) |
| #define | OPEN_BSL_PASSWORD_LENGTH (8) |
| #define | OPEN_BSL_CHKSUM_LEN (2) |
Enumerations | |
| enum | OpenBSL_Cmd_t { OPEN_BSL_CMD_SYNC = 0x80 } |
| enum | OpenBSL_Resp_t { OPEN_BSL_RESP_OK = 0x00, OPEN_BSL_RESP_ERR_UNKNOWN_CMD = 0xE1, OPEN_BSL_RESP_ERR_UNSUPPORTED_CMD = 0xE2, OPEN_BSL_RESP_ERR_PASSWORD_PROTECTED = 0xE3, OPEN_BSL_RESP_ERR_INVALID_PARAM = 0xE4, OPEN_BSL_RESP_ERR_INVALID_FORMAT = 0xE5, OPEN_BSL_RESP_ERR_INVALID_CHECKSUM = 0xE6 } |
Functions | |
| void | OpenBSL_CalcChksum (uint8_t byte, uint16_t *checksum) |
| OpenBSL checksum calcuation routine - based on the simple BSD checksum algorithm. More... | |
| void | OpenBSL_DevInit (void) |
| device/HW initialization function for OpenBSL More... | |
| bool | OpenBSL_EntryCheck (void) |
| check whether it is necessary to run BSL or application More... | |
| void | OpenBSL_AssertHdl (void) |
| assert handle function More... | |
| void | OpenBSL_Jump (memAddr_t addr) |
| run application, leave BSL mode More... | |
| void | OpenBSL_ProcGetMemInfo (void) |
| send memory info regarding on-chip non-volatile memory More... | |
| void | OpenBSL_ProcEraseImg (void) |
| erase application image/memory area More... | |
| void | OpenBSL_ProcDnldImg (void) |
| download/write incoming byte streams to application image/memory area, ended with 2 checksum bytes More... | |
| void | OpenBSL_ProcUpldImg (void) |
| upload/read application image/memory area as byte streams, ended with 2 checksum bytes More... | |
| void | OpenBSL_ProcCalcChksm (void) |
| calculate 2 checksum bytes of given memory area More... | |
| void | OpenBSL_ProcEraseSegment (void) |
| erase certain part of application image/memory area More... | |
| void | OpenBSL_ProcDnldSegment (void) |
| download/write input bytes to certain part of application image/memory area More... | |
| void | OpenBSL_ProcUpldSegment (void) |
| upload/read bytes from certain part of application image/memory area More... | |
| void | OpenBSL_ProcPwdCmd (void) |
| process incoming password to unlock other commands More... | |
| void | OpenBSL_ProcJumpToAddr (void) |
| process command to jump to certain given address More... | |
| void | OpenBSL_ProcRunApp (void) |
| process command to run application (jump to application reset vector at address APP_MEM_RESET_VECT_ADDR More... | |
| void | OpenBSL_CommInit (void) |
| device/HW initialization communication module function for OpenBSL More... | |
| uint8_t | OpenBSL_CommRcvByte (void) |
| receive a single byte from communication line - blocking function More... | |
| uint8_t | OpenBSL_CommRcvByteChksum (void) |
| receive a single byte from communication line and update the OpenBSL_InChecksum checksum variable - blocking function More... | |
| uint16_t | OpenBSL_CommRcvShort (void) |
| receive a two bytes data (16 bit) from communication line - blocking function More... | |
| uint16_t | OpenBSL_CommRcvShortChksum (void) |
| receive a two bytes data (16 bit) from communication line and calculate/update the OpenBSL_InChecksum checksum variable - blocking function More... | |
| uint32_t | OpenBSL_CommRcvLong (void) |
| receive a four bytes data (32 bit) from communication line - blocking function More... | |
| uint32_t | OpenBSL_CommRcvLongChksum (void) |
| receive a four bytes data (32 bit) from communication line and calculate/update the OpenBSL_InChecksum checksum variable - blocking function More... | |
| void | OpenBSL_CommSendByte (uint8_t byte) |
| send a single byte to communication line - blocking function More... | |
| void | OpenBSL_CommSendByteChksum (uint8_t byte) |
| send a single byte to communication line and update the OpenBSL_OutChecksum checksum variable - blocking function More... | |
| void | OpenBSL_CommSendShort (uint16_t val) |
| send a two bytes (16 bit) value to communication line in little endian byte order (LSB first) - blocking function More... | |
| void | OpenBSL_CommSendShortChksum (uint16_t val) |
| send a two bytes (16 bit) to communication line and update the OpenBSL_OutChecksum checksum variable - blocking function More... | |
| void | OpenBSL_CommSendLong (uint32_t val) |
| send a four bytes (32 bit) value to communication line in little endian byte order (LSB first) - blocking function More... | |
| void | OpenBSL_CommSendLongChksum (uint32_t val) |
| send a four bytes (32 bit) to communication line and update the OpenBSL_OutChecksum checksum variable - blocking function More... | |
| void | OpenBSL_MemInit (void) |
| device/HW initialization memory module function for OpenBSL More... | |
| uint8_t | OpenBSL_MemReadByte (memAddr_t address) |
| read byte from device memory More... | |
| void | OpenBSL_MemOpenForErase (uint8_t section) |
| open memory for erase operation More... | |
| void | OpenBSL_MemErase (memAddr_t address) |
| erase an address/segment from device memory More... | |
| void | OpenBSL_MemCloseForErase (uint8_t section) |
| close memory for erase operation More... | |
| void | OpenBSL_MemOpenForWrite (uint8_t section) |
| open memory for write operation More... | |
| void | OpenBSL_MemWrite (uint8_t byte, memAddr_t address) |
| write byte to device memory More... | |
| void | OpenBSL_MemCloseForWrite (uint8_t section) |
| close memory for write operation More... | |
| uint8_t | OpenBSL_MemChkSection (memAddr_t address, memAddr_t end) |
| check for validity of a given memory section parameter More... | |
| uint32_t | OpenBSL_MemSgmntGetSize (uint8_t section) |
| get device memory segment size More... | |
Variables | |
| uint16_t | OpenBSL_InChecksum |
| uint16_t | OpenBSL_OutChecksum |
OpenBSL internal header file.
| #define OPEN_BSL_CMD_FUNC_TABLE |
OPEN_BSL_CMD_FUNC_TABLE X Macro for OpenBSL commands - processing functions table
| #define OPEN_BSL_RESP_BIT_MASK (0x80) |
OPEN_BSL_RESP_BIT_MASK response bit mask for positive response of incoming command
| enum OpenBSL_Cmd_t |
OpenBSL_Cmd_t OpenBSL supported list of commands
| enum OpenBSL_Resp_t |
OpenBSL_Resp_t OpenBSL supported list of response
| void OpenBSL_AssertHdl | ( | void | ) |
assert handle function
OpenBSL_AssertHdl
| - |
| void OpenBSL_CalcChksum | ( | uint8_t | byte, |
| uint16_t * | checksum | ||
| ) |
OpenBSL checksum calcuation routine - based on the simple BSD checksum algorithm.
| [in] | byte | input byte |
| [out] | checksum | pointer to the checksum buffer |
| void OpenBSL_CommInit | ( | void | ) |
device/HW initialization communication module function for OpenBSL
OpenBSL_CommInit
| - |
| uint8_t OpenBSL_CommRcvByte | ( | void | ) |
receive a single byte from communication line - blocking function
OpenBSL_CommRcvByte
| - |
| uint8_t OpenBSL_CommRcvByteChksum | ( | void | ) |
receive a single byte from communication line and update the OpenBSL_InChecksum checksum variable - blocking function
OpenBSL_CommRcvByteChksum
| [in] | checksum | pointer to the checksum buffer to be updated |
| uint32_t OpenBSL_CommRcvLong | ( | void | ) |
receive a four bytes data (32 bit) from communication line - blocking function
OpenBSL_CommRcvLong
| - |
| uint32_t OpenBSL_CommRcvLongChksum | ( | void | ) |
receive a four bytes data (32 bit) from communication line and calculate/update the OpenBSL_InChecksum checksum variable - blocking function
OpenBSL_CommRcvLongChksum
| - |
| uint16_t OpenBSL_CommRcvShort | ( | void | ) |
receive a two bytes data (16 bit) from communication line - blocking function
OpenBSL_CommRcvShort
| - |
| uint16_t OpenBSL_CommRcvShortChksum | ( | void | ) |
receive a two bytes data (16 bit) from communication line and calculate/update the OpenBSL_InChecksum checksum variable - blocking function
OpenBSL_CommRcvShortChksum
| - |
| void OpenBSL_CommSendByte | ( | uint8_t | byte | ) |
send a single byte to communication line - blocking function
OpenBSL_CommSendByte
| single | byte to be sent out to communication line |
| void OpenBSL_CommSendByteChksum | ( | uint8_t | byte | ) |
send a single byte to communication line and update the OpenBSL_OutChecksum checksum variable - blocking function
OpenBSL_CommSendByteChksum
| [in] | byte | input byte to be sent out |
| void OpenBSL_CommSendLong | ( | uint32_t | val | ) |
send a four bytes (32 bit) value to communication line in little endian byte order (LSB first) - blocking function
OpenBSL_CommSendLong
| [in] | val | 32 bit data to be sent out to communication line |
| void OpenBSL_CommSendLongChksum | ( | uint32_t | val | ) |
send a four bytes (32 bit) to communication line and update the OpenBSL_OutChecksum checksum variable - blocking function
OpenBSL_CommSendLongChksum
| [in] | val | input word (32 bit) to be sent out |
| void OpenBSL_CommSendShort | ( | uint16_t | val | ) |
send a two bytes (16 bit) value to communication line in little endian byte order (LSB first) - blocking function
OpenBSL_CommSendShort
| [in] | val | 16 bit data to be sent out to communication line |
| void OpenBSL_CommSendShortChksum | ( | uint16_t | val | ) |
send a two bytes (16 bit) to communication line and update the OpenBSL_OutChecksum checksum variable - blocking function
OpenBSL_CommSendShortChksum
| [in] | val | input word (16 bit) to be sent out |
| void OpenBSL_DevInit | ( | void | ) |
device/HW initialization function for OpenBSL
OpenBSL_DevInit
| - |
| bool OpenBSL_EntryCheck | ( | void | ) |
check whether it is necessary to run BSL or application
OpenBSL_EntryCheck
| - |
| void OpenBSL_Jump | ( | memAddr_t | addr | ) |
run application, leave BSL mode
OpenBSL_Jump
| - |
| uint8_t OpenBSL_MemChkSection | ( | memAddr_t | start, |
| memAddr_t | end | ||
| ) |
check for validity of a given memory section parameter
OpenBSL_MemChkSection
| [in] | start | start address |
| [in] | end | end address |
| void OpenBSL_MemCloseForErase | ( | uint8_t | section | ) |
close memory for erase operation
OpenBSL_MemCloseForErase
| [in] | section | memory section number to be erased |
| void OpenBSL_MemCloseForWrite | ( | uint8_t | section | ) |
close memory for write operation
OpenBSL_MemCloseForWrite
| [in] | section | memory section number to be written |
| void OpenBSL_MemErase | ( | memAddr_t | address | ) |
erase an address/segment from device memory
OpenBSL_MemErase
| [in] | address | memory address to be erased |
| void OpenBSL_MemInit | ( | void | ) |
device/HW initialization memory module function for OpenBSL
OpenBSL_MemInit
| - |
| void OpenBSL_MemOpenForErase | ( | uint8_t | section | ) |
open memory for erase operation
OpenBSL_MemOpenForErase
| [in] | section | memory section number to be erased |
| void OpenBSL_MemOpenForWrite | ( | uint8_t | section | ) |
open memory for write operation
OpenBSL_MemOpenForWrite
| [in] | section | memory section number to be written |
| uint8_t OpenBSL_MemReadByte | ( | memAddr_t | address | ) |
read byte from device memory
OpenBSL_MemReadByte
| address | address/pointer to the memory address to be read |
| uint32_t OpenBSL_MemSgmntGetSize | ( | uint8_t | section | ) |
get device memory segment size
OpenBSL_MemSgmntGetSize
| [in] | section | memory section number |
| void OpenBSL_MemWrite | ( | uint8_t | byte, |
| memAddr_t | address | ||
| ) |
write byte to device memory
OpenBSL_MemWrite
| [in] | byte | data byte to be written |
| [in] | address | memory address to be written |
| void OpenBSL_ProcCalcChksm | ( | void | ) |
calculate 2 checksum bytes of given memory area
OpenBSL_ProcCalcChksm
| - |
| void OpenBSL_ProcDnldImg | ( | void | ) |
download/write incoming byte streams to application image/memory area, ended with 2 checksum bytes
OpenBSL_ProcDnldImg
| - |
| void OpenBSL_ProcDnldSegment | ( | void | ) |
download/write input bytes to certain part of application image/memory area
OpenBSL_ProcDnldSegment
| - |
| void OpenBSL_ProcEraseImg | ( | void | ) |
erase application image/memory area
OpenBSL_ProcEraseImg
| - |
| void OpenBSL_ProcEraseSegment | ( | void | ) |
erase certain part of application image/memory area
OpenBSL_ProcEraseSegment
| - |
| void OpenBSL_ProcGetMemInfo | ( | void | ) |
send memory info regarding on-chip non-volatile memory
OpenBSL_ProcGetMemInfo
| - |
| void OpenBSL_ProcJumpToAddr | ( | void | ) |
process command to jump to certain given address
OpenBSL_ProcJumpToAddr
| - |
CMD packet format:
CMD (1 byte) = OPEN_BSL_CMD_JUMP_TO_ADDR ADDR (4 bytes) =
positive RESPONSE packet format:
RESP (1 byte) = OPEN_BSL_CMD_JUMP_TO_ADDR | OPEN_BSL_RESP_BIT_MASK
| void OpenBSL_ProcPwdCmd | ( | void | ) |
process incoming password to unlock other commands
OpenBSL_ProcPwdCmd
| - |
| void OpenBSL_ProcRunApp | ( | void | ) |
process command to run application (jump to application reset vector at address APP_MEM_RESET_VECT_ADDR
OpenBSL_ProcRun
| - |
CMD packet format:
CMD (1 byte) = OPEN_BSL_CMD_RUN_APP
positive RESPONSE packet format:
RESP (1 byte) = OPEN_BSL_CMD_RUN_APP | OPEN_BSL_RESP_BIT_MASK
| void OpenBSL_ProcUpldImg | ( | void | ) |
upload/read application image/memory area as byte streams, ended with 2 checksum bytes
OpenBSL_ProcUpldImg
| - |
| void OpenBSL_ProcUpldSegment | ( | void | ) |
upload/read bytes from certain part of application image/memory area
OpenBSL_ProcUpldSegment
| - |
1.8.5