Add API support signature to the CDC and DFU class bootloaders, so that the application can detect the bootloader's API support.
This commit is contained in:
parent
3dacb73af3
commit
43a3350981
7 changed files with 39 additions and 16 deletions
|
@ -32,12 +32,17 @@
|
|||
.section .apitable, "ax"
|
||||
.org 0
|
||||
|
||||
; API function jump table
|
||||
.global BootloaderAPI_JumpTable
|
||||
BootloaderAPI_JumpTable:
|
||||
jmp BootloaderAPI_ErasePage
|
||||
jmp BootloaderAPI_WritePage
|
||||
jmp BootloaderAPI_FillWord
|
||||
jmp BootloaderAPI_ReadSignature
|
||||
jmp BootloaderAPI_ReadFuse
|
||||
jmp BootloaderAPI_ReadLock
|
||||
jmp BootloaderAPI_WriteLock
|
||||
rjmp BootloaderAPI_ErasePage
|
||||
rjmp BootloaderAPI_WritePage
|
||||
rjmp BootloaderAPI_FillWord
|
||||
rjmp BootloaderAPI_ReadSignature
|
||||
rjmp BootloaderAPI_ReadFuse
|
||||
rjmp BootloaderAPI_ReadLock
|
||||
rjmp BootloaderAPI_WriteLock
|
||||
|
||||
; Bootloader table signature
|
||||
.org 30
|
||||
.word 0xDCFB
|
||||
|
|
|
@ -108,8 +108,14 @@
|
|||
* uint8_t (*BootloaderAPI_ReadFuse)(uint16_t Address) = BOOTLOADER_API_START(4);
|
||||
* uint8_t (*BootloaderAPI_ReadLock)(void) = BOOTLOADER_API_START(5);
|
||||
* void (*BootloaderAPI_WriteLock)(uint8_t LockBits) = BOOTLOADER_API_START(6);
|
||||
*
|
||||
* #define BOOTLOADER_SIG_START (FLASHEND - 32)
|
||||
* #define BOOTLOADER_SIGNATURE 0xDCFB
|
||||
* \endcode
|
||||
*
|
||||
* From the application the API support of the bootloader can be detected by reading the FLASH memory bytes located at address
|
||||
* \c BOOTLOADER_SIG_START and comparing them to the value \c BOOTLOADER_SIGNATURE.
|
||||
*
|
||||
* \section Sec_Options Project Options
|
||||
*
|
||||
* The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue