|
1 | 1 | USB DFU Bootloader for SAMD11 / SAMD21 |
2 | 2 | ====================================== |
3 | 3 |
|
4 | | -Bootloaders are a dime a dozen, but existing USB bootloaders for the Atmel/Microchip SAMDx1 all seem to be 4kBytes in size. To spend 25% of the SAMD11's flash on the bootloader seems quite excessive. |
| 4 | +Bootloaders may be a dime a dozen, but existing USB bootloaders for the Atmel/Microchip SAMD11/SAMD21 all seem to be 4kBytes or 8kBytes in size. To spend 25% or 50% of the SAMD11's flash on the bootloader seems quite excessive. The SAMD21 may have more flash to spare than the SAMD11, but why be so wasteful with it? |
5 | 5 |
|
6 | | -This bootloader is only 1kBytes and implements the industry-standard [DFU protocol](http://www.usb.org/developers/docs/devclass_docs/DFU_1.1.pdf) that is supported under multiple Operating Systems via existing tools such as [dfu-util](http://dfu-util.sourceforge.net/). |
| 6 | +This USB bootloader is only 1kBytes and implements the industry-standard [DFU protocol](http://www.usb.org/developers/docs/devclass_docs/DFU_1.1.pdf) that is supported under multiple Operating Systems via existing tools such as [dfu-util](http://dfu-util.sourceforge.net/). |
7 | 7 |
|
8 | | -It is a much more space efficient alternative to the 4kB Atmel/Microchip [AN_42366](http://www.microchip.com//wwwAppNotes/AppNotes.aspx?appnote=en591491) SAM-BA Bootloader. |
| 8 | +It is a much more space efficient alternative to the 4kB Atmel/Microchip [AN_42366](http://www.microchip.com//wwwAppNotes/AppNotes.aspx?appnote=en591491) SAM-BA Bootloader or the positively gluttonous 8kB Arduino Zero bootloaders. |
9 | 9 |
|
10 | 10 | ## Usage |
11 | 11 |
|
12 | | -Downloading can be accomplished with the existing [dfu-util](http://dfu-util.sourceforge.net/) utilities. |
| 12 | +Downloading can be accomplished with any software that supports DFU, which includes the existing [dfu-util](http://dfu-util.sourceforge.net/) utilities. |
13 | 13 |
|
14 | | -Using the provided dx1elf2dfu utility, one can create a .dfu file; that file can then be downloaded like so: |
| 14 | +Using the provided dx1elf2dfu utility, one can create a .dfu file. The DFU software will accept that file; with [dfu-util](http://dfu-util.sourceforge.net/), downloading is like so: |
15 | 15 |
|
16 | 16 | ``` |
17 | 17 | dfu-util -D write.dfu |
18 | 18 | ``` |
19 | 19 |
|
20 | 20 | ## Specifics |
21 | 21 |
|
| 22 | +Source code for some example apps is provided in the 'example-apps' subdirectory. |
| 23 | + |
22 | 24 | The linker memory map of the user application must be modified to have an origin at 0x0000_0400 rather than at 0x0000_0000. This bootloader resides at 0x0000_0000. |
23 | 25 |
|
24 | 26 | When booting, the bootloader checks whether a GPIO pin (nominally PA15) is connected to ground. It also computes a CRC32 of the user application. If the user application is unprogrammed or corrupted, the CRC32 check should fall. If the CRC32 check fails or the GPIO pin is grounded, it runs the bootloader instead of the user application. |
|
0 commit comments