Overview:
As many electronic designs evolve rapidly there is a growing need for being able to update products, which have already been shipped or sold. Microcontrollers that support boot loader facilitates updating the application flash section without the need of an external programmer, are of great use in situations where the application has to be updated on the field. The boot loader may use various interfaces like SPI, UART, TWI, Ethernet etc.
This application implements a I2C Slave bootloader for SAM devices.
This application has been tested on following boards:
This bootloader implementation consumes around 8000 bytes (approximately), which is 32 rows of Program Memory space starting from 0x00000000. BOOTPROT fuses on the device can be set to protect first 32 rows of the program memory which are allocated for the BOOT section. So, the end user application should be generated with starting address as 0x00002000.
There are no prerequisites for this implementation
SAM device in SAM Xplained Pro kit is used as the I2C Slave. I2C master should be connected to PIN11 (PA08 - SDA) and PIN12 (PA09 - SCL) on External header 1 (EXT1) of SAM D20/D21 Xplained Pro. I2C master should be connected to PIN11 (PA16 - SDA) and PIN12 (PA17 - SCL) on External header 1 (EXT1) of SAM R21 Xplained Pro. I2C master should be connected to PIN11 (PA22 - SDA) and PIN12 (PA23 - SCL) on External header 1 (EXT1) of SAM D10/D11 Xplained Pro. I2C master should be connected to PIN11 (PB30 - SDA) and PIN12 (PB31 - SCL) on External header 1 (EXT1) of SAM L22 Xplained Pro. I2C master should be connected to PIN11 (PA08 - SDA) and PIN12 (PA09 - SCL) on External header 1 (EXT1) of SAM L21 Xplained Pro. SW0 will be configured as BOOT_LOAD_PIN and LED0 will be used to display the bootloader status. LED0 will be ON when the device is in bootloader mode.
The bootloader is located at the start of the program memory and is executed at each reset/power-on sequence. Initially check the status of a user configurable BOOT_LOAD_PIN.
Initialize the following
Once the programming is completed, enable Watchdog Timer with a timeout period of 256 clock cycles and wait in a loop for Watchdog to reset the device.
This software was written for the GNU GCC and IAR for ARM. Other compilers may or may not work.
For further information, visit http://www.microchip.com.