X-Git-Url: http://git.linex4red.de/pub/lufa.git/blobdiff_plain/1ab76048c9c727a588a0cc0fab285222b5916df5..refs/heads/master:/Bootloaders/DFU/BootloaderDFU.txt diff --git a/Bootloaders/DFU/BootloaderDFU.txt b/Bootloaders/DFU/BootloaderDFU.txt index 2c9eaf1de..b2540a5b6 100644 --- a/Bootloaders/DFU/BootloaderDFU.txt +++ b/Bootloaders/DFU/BootloaderDFU.txt @@ -10,10 +10,10 @@ * * The following list indicates what microcontrollers are compatible with this demo. * - * - Series 7 USB AVRs (AT90USBxxx7) - * - Series 6 USB AVRs (AT90USBxxx6) - * - Series 4 USB AVRs (ATMEGAxxU4) - * - Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) + * \li Series 7 USB AVRs (AT90USBxxx7) + * \li Series 6 USB AVRs (AT90USBxxx6) + * \li Series 4 USB AVRs (ATMEGAxxU4) - See \ref SSec_Aux_Space + * \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) - See \ref SSec_Aux_Space * * \section Sec_Info USB Information: * @@ -37,8 +37,9 @@ * USBIF DFU Class Standard, Atmel USB Bootloader Datasheet * * - * Usable Speeds: - * Full Speed Mode + * Supported USB Speeds: + * Low Speed Mode \n + * Full Speed Mode * * * @@ -54,6 +55,30 @@ * When the bootloader is running, the board's LED(s) will flash at regular intervals to distinguish the * bootloader from the normal user application. * + * \section Sec_Running Running the Bootloader + * + * On the USB AVR8 devices, setting the \c HWBE device fuse will cause the bootloader to run if the \c HWB pin of + * the AVR is grounded when the device is reset. + * + * The are two behaviours of this bootloader, depending on the device's fuses: + * + * If the device's BOOTRST fuse is set, the bootloader will run any time the system is reset from + * the external reset pin, unless no valid user application has been loaded. To initiate the bootloader, the + * device's external reset pin should be grounded momentarily. + * + * If the device's BOOTRST fuse is not set, the bootloader will run only if initiated via a software + * jump, or if the \c HWB pin was low during the last device reset (if the \c HWBE fuse is set). + * + * For board specific exceptions to the above, see below. + * + * \subsection SSec_XPLAIN Atmel Xplain Board + * Ground the USB AVR JTAG's \c TCK pin to ground when powering on the board to start the bootloader. This assumes the + * \c HWBE fuse is cleared and the \c BOOTRST fuse is set as the HWBE pin is not user accessible on this board. + * + * \subsection SSec_Leonardo Arduino Leonardo Board + * Ground \c IO13 when powering the board to start the bootloader. This assumes the \c HWBE fuse is cleared and the + * \c BOOTRST fuse is set as the HWBE pin is not user accessible on this board. + * * \section Sec_Installation Driver Installation * * This bootloader is designed to be compatible with Atmel's provided Windows DFU class drivers. You will need to @@ -67,7 +92,7 @@ * manually change them in Descriptors.c and alter your driver's INF file accordingly. * * \section Sec_HostApp Host Controller Application - * + * * This bootloader is compatible with Atmel's FLIP utility on Windows machines, and dfu-programmer on Linux machines. * * \subsection SSec_FLIP FLIP (Windows) @@ -100,7 +125,9 @@ * following layout: * * \code - * #define BOOTLOADER_API_CALL(Index) (void*)(((FLASHEND - 32) + (2 * Index)) / 2) + * #define BOOTLOADER_API_TABLE_SIZE 32 + * #define BOOTLOADER_API_TABLE_START ((FLASHEND + 1UL) - BOOTLOADER_API_TABLE_SIZE) + * #define BOOTLOADER_API_CALL(Index) (void*)((BOOTLOADER_API_TABLE_START + (Index * 2)) / 2) * * void (*BootloaderAPI_ErasePage)(uint32_t Address) = BOOTLOADER_API_CALL(0); * void (*BootloaderAPI_WritePage)(uint32_t Address) = BOOTLOADER_API_CALL(1); @@ -110,38 +137,98 @@ * uint8_t (*BootloaderAPI_ReadLock)(void) = BOOTLOADER_API_CALL(5); * void (*BootloaderAPI_WriteLock)(uint8_t LockBits) = BOOTLOADER_API_CALL(6); * - * #define BOOTLOADER_MAGIC_SIGNATURE_START (FLASHEND - 2) + * #define BOOTLOADER_MAGIC_SIGNATURE_START (BOOTLOADER_API_TABLE_START + (BOOTLOADER_API_TABLE_SIZE - 2)) * #define BOOTLOADER_MAGIC_SIGNATURE 0xDCFB * - * #define BOOTLOADER_CLASS_SIGNATURE_START (FLASHEND - 4) - * #define BOOTLOADER_DFU_SIGNATURE 0xDFB1 + * #define BOOTLOADER_CLASS_SIGNATURE_START (BOOTLOADER_API_TABLE_START + (BOOTLOADER_API_TABLE_SIZE - 4)) + * #define BOOTLOADER_DFU_SIGNATURE 0xDF10 * - * #define BOOTLOADER_ADDRESS_START (FLASHEND - 8) + * #define BOOTLOADER_ADDRESS_START (BOOTLOADER_API_TABLE_START + (BOOTLOADER_API_TABLE_SIZE - 8)) * #define BOOTLOADER_ADDRESS_LENGTH 4 * \endcode * * From the application the API support of the bootloader can be detected by reading the FLASH memory bytes located at address * \c BOOTLOADER_MAGIC_SIGNATURE_START and comparing them to the value \c BOOTLOADER_MAGIC_SIGNATURE. The class of bootloader * can be determined by reading the FLASH memory bytes located at address \c BOOTLOADER_CLASS_SIGNATURE_START and comparing them - * to the value \c BOOTLOADER_CDC_SIGNATURE. The start address of the bootloader can be retrieved by reading the bytes of FLASH + * to the value \c BOOTLOADER_DFU_SIGNATURE. The start address of the bootloader can be retrieved by reading the bytes of FLASH * memory starting from address \c BOOTLOADER_ADDRESS_START. * + * \subsection SSec_API_MemLayout Device Memory Map + * The following illustration indicates the final memory map of the device when loaded with the bootloader. + * + * \verbatim + * +----------------------------+ 0x0000 + * | | + * | | + * | | + * | | + * | | + * | | + * | | + * | | + * | User Application | + * | | + * | | + * | | + * | | + * | | + * | | + * | | + * | | + * +----------------------------+ FLASHEND - BOOT_AUX_SECTION_SIZE + * | Booloader Start Trampoline | + * | (Not User App. Accessible) | + * +----------------------------+ FLASHEND - (BOOT_AUX_SECTION_SIZE - 4) + * | | + * | Auxillery Bootloader | + * | Space for Smaller Devices | + * | (Not User App. Accessible) | + * | | + * +----------------------------+ FLASHEND - BOOT_SECTION_SIZE + * | | + * | Bootloader Application | + * | (Not User App. Accessible) | + * | | + * +----------------------------+ FLASHEND - 96 + * | API Table Trampolines | + * | (Not User App. Accessible) | + * +----------------------------+ FLASHEND - 32 + * | Bootloader API Table | + * | (User App. Accessible) | + * +----------------------------+ FLASHEND - 8 + * | Bootloader ID Constants | + * | (User App. Accessible) | + * +----------------------------+ FLASHEND + * \endverbatim + * + * \subsection SSec_Aux_Space Auxiliary Bootloader Section + * To make the bootloader function on smaller devices (those with a physical + * bootloader section of smaller than 6KB) + * + * \section Sec_KnownIssues Known Issues: + * + * \par On Linux machines, the DFU bootloader is inaccessible. + * On many Linux systems, non-root users do not have automatic access to newly + * inserted DFU devices. Root privileges or a UDEV rule is required to gain + * access. + * See here for resolution steps. + * * \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. * * * - * - * - * + * + * + * * * * - * - * + * + * being dumped by unauthorized persons. When false, all memory operations are allowed at any time. * *
Define Name:Location:Description:Define Name:Location:Description:
SECURE_MODEBootloaderDFU.hIf defined to true, the bootloader will not accept any memory commands other than a chip erase on start-up, until an + * AppConfig.hIf defined to \c true, the bootloader will not accept any memory commands other than a chip erase on start-up, until an * erase has been performed. This can be used in conjunction with the AVR's lockbits to prevent the AVRs firmware from - * being dumped by unauthorized persons.
*/