Add API support signature to the CDC and DFU class bootloaders, so that the applicati...
authorDean Camera <dean@fourwalledcubicle.com>
Fri, 3 Feb 2012 21:49:36 +0000 (21:49 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Fri, 3 Feb 2012 21:49:36 +0000 (21:49 +0000)
Bootloaders/CDC/BootloaderAPI.c
Bootloaders/CDC/BootloaderAPITable.S
Bootloaders/CDC/BootloaderCDC.txt
Bootloaders/CDC/Descriptors.c
Bootloaders/DFU/BootloaderAPITable.S
Bootloaders/DFU/BootloaderDFU.txt
LUFA/DoxygenPages/ChangeLog.txt

index 326adb4..26705f8 100644 (file)
@@ -71,4 +71,3 @@ void BootloaderAPI_WriteLock(const uint8_t LockBits)
 {
        boot_lock_bits_set_safe(LockBits);
 }
 {
        boot_lock_bits_set_safe(LockBits);
 }
-
index 7f015f2..b1d1b05 100644 (file)
 .section .apitable, "ax"
 .org 0
 
 .section .apitable, "ax"
 .org 0
 
+; API function jump table
 .global BootloaderAPI_JumpTable
 BootloaderAPI_JumpTable:
 .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
index ab45ad1..584143e 100644 (file)
  *  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);
  *  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
  *
  *  \endcode
  *
+ *  Bootloaders reporting a device release revision number of 1.00 or greater are bootloader API enabled. 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.
  *  \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.
index bf8c819..18afdf8 100644 (file)
@@ -55,7 +55,7 @@ const USB_Descriptor_Device_t DeviceDescriptor =
 
        .VendorID               = 0x03EB,
        .ProductID              = 0x204A,
 
        .VendorID               = 0x03EB,
        .ProductID              = 0x204A,
-       .ReleaseNumber          = VERSION_BCD(00.01),
+       .ReleaseNumber          = VERSION_BCD(01.00),
 
        .ManufacturerStrIndex   = NO_DESCRIPTOR,
        .ProductStrIndex        = 0x01,
 
        .ManufacturerStrIndex   = NO_DESCRIPTOR,
        .ProductStrIndex        = 0x01,
index 7f015f2..b1d1b05 100644 (file)
 .section .apitable, "ax"
 .org 0
 
 .section .apitable, "ax"
 .org 0
 
+; API function jump table
 .global BootloaderAPI_JumpTable
 BootloaderAPI_JumpTable:
 .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
index 94657f3..f7f5ee9 100644 (file)
  *  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);
  *  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
  *
  *  \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.
  *  \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.
index bb00436..7fc06bd 100644 (file)
@@ -31,6 +31,7 @@
   *   - Altered the Mass Storage Host class driver so that SCSI data STALLs from the attached device can be recovered from automatically without
   *     having to reset the Mass Storage interface
   *   - USB_CONFIG_ATTR_BUSPOWERED constant renamed to USB_CONFIG_ATTR_RESERVED, as this was misnamed (thanks to NXP Semiconductors)
   *   - Altered the Mass Storage Host class driver so that SCSI data STALLs from the attached device can be recovered from automatically without
   *     having to reset the Mass Storage interface
   *   - USB_CONFIG_ATTR_BUSPOWERED constant renamed to USB_CONFIG_ATTR_RESERVED, as this was misnamed (thanks to NXP Semiconductors)
+  *   - Reordered board name definition indexes so that a mispelled BOARD compile option will default to BOARD_USER rather than BOARD_USBKEY
   *  - Library Applications:
   *   - Altered the Mass Storage Host LowLevel demo so that SCSI data STALLs from the attached device can be recovered from automatically without
   *     having to reset the Mass Storage interface
   *  - Library Applications:
   *   - Altered the Mass Storage Host LowLevel demo so that SCSI data STALLs from the attached device can be recovered from automatically without
   *     having to reset the Mass Storage interface