
MT-D21E
User Guide
SAMBA USB CDC Bootloader (Arduino Compatible)
SAMBA USB CDC Bootloader (Arduino Compatible)
The SAMBA bootloader has both a CDC USB interface, and a UART interface (MTD21E:
TX: pin 10, RX: pin 11). It is compatible with the Arduino IDE (Zero compatible), or it can be
used with the Bossac tool standalone. Under Arduino, autoreset is supported (automatically
runs the bootloader while the sketch is running) as well as automatic return from reset. The
SAMBA bootloader described here adds to the Arduino version, which in turn is based on the
bootloader from Atmel. The Arduino version added several features, including three new
commands (Arduino Extended Capabilities) that increase upload speed. The bootloader
normally requires 8 KB FLASH, however, a 4 KB version can be used for the D11 chips.
Bossac is a command line utility for uploading firmware to SAMBA bootloaders. It runs on
Windows. Linux, and OS X. It is used by Arduino to upload firmware to SAM and SAMD
boards. The version Bossac described here adds to the Arduino version
(
https://github.com/shumatech/BOSSA
, Arduino branch), which in turn is a fork from the
original Bossa (
http://www.shumatech.com/web/products/bossa
). It adds support for more
SAMD chips (both D21 and D11).
Note that only the Arduino or Mattairtech versions of bossac are currently supported for
SAMD chips. Neither the stock bossac (or Bossa) nor the Atmel SAMBA upload tool will
work.
Arduino Extended Capabilities:
●
X: Erase the flash memory starting from ADDR to the end of flash.
●
Y: Write the content of a buffer in SRAM into flash memory.
●
Z: Calculate the CRC for a given area of memory.
The bootloader can be started by:
●
Tapping reset twice in quick succession (BOOT_DOUBLE_TAP).
●
Holding down button A (BOOT_LOAD_PIN) while powering up.
●
Clicking 'Upload Sketch' in the Arduino IDE, which will automatically start the bootloader.
●
If the application (sketch) area is blank, the bootloader will run.
Otherwise, it jumps to application and starts execution from there. The LED will light during
bootloader execution. Note that the 4KB bootloader does not support the Arduino Extended
Capabilities or BOOT_DOUBLE_TAP. However, BOOT_DOUBLE_TAP does fit into the
SAMD11 4KB bootloader.
When the Arduino IDE initiates the bootloader, the following procedure is used:
1.
The IDE opens and closes the USB serial port at a baud rate of 1200bps. This triggers a “soft
erase” procedure.
2.
The first row of application section flash memory is erased by the MCU. If it is interrupted for
July 11, 2016
26