ArduinoCore-samd/bootloaders/zero
ladyada 10a9c83c3d Merge remote-tracking branch 'upstream/master'
Conflicts:
	boards.txt
	platform.txt
2017-04-21 14:17:17 -04:00
..
board_definitions.h Added bootloader and boards definition for MKRFox1200 board 2017-04-04 10:48:18 +02:00
board_definitions_arduino_mkr1000.h bootloader: use correct SERCOMx_GCLK definition from CMSIS 2016-12-07 09:19:46 -05:00
board_definitions_arduino_mkrfox1200.h Added bootloader and boards definition for MKRFox1200 board 2017-04-04 10:48:18 +02:00
board_definitions_arduino_mkrzero.h Added support for MKRZero 2016-12-07 09:19:46 -05:00
board_definitions_arduino_zero.h bootloader: use correct SERCOMx_GCLK definition from CMSIS 2016-12-07 09:19:46 -05:00
board_definitions_genuino_mkr1000.h bootloader: use correct SERCOMx_GCLK definition from CMSIS 2016-12-07 09:19:46 -05:00
board_definitions_genuino_zero.h bootloader: use correct SERCOMx_GCLK definition from CMSIS 2016-12-07 09:19:46 -05:00
board_driver_led.c Move SysTick_Handler to main.c and create LED_pulse function 2016-09-22 15:40:27 +02:00
board_driver_led.h Bootloader LEDs are now optional 2016-09-22 19:02:37 +02:00
board_driver_serial.c [bl] Updating copyrights 2015-10-10 15:57:00 +02:00
board_driver_serial.h bootloader: use correct SERCOMx_GCLK definition from CMSIS 2016-12-07 09:19:46 -05:00
board_driver_usb.c Update boot loader source to use new CMSIS packages 2016-12-19 16:54:59 -05:00
board_driver_usb.h [bl] Updating copyrights 2015-10-10 15:57:00 +02:00
board_init.c [bl] Updating copyrights 2015-10-10 15:57:00 +02:00
board_startup.c Move SysTick_Handler to main.c and create LED_pulse function 2016-09-22 15:40:27 +02:00
bootloader_samd21x18.ld [bl] Fixing bug in jump to application 2015-10-10 15:48:15 +02:00
build_all_bootloaders.sh Merge remote-tracking branch 'upstream/master' 2017-04-21 14:17:17 -04:00
main.c Check sketch vectors before waiting for double tap 2016-11-28 11:38:00 -05:00
Makefile Fix bootloader make script 2017-02-08 12:34:54 +01:00
README.md Bootloader makefile has been refactored for easier customization 2016-09-22 19:05:43 +02:00
sam_ba_cdc.c Update boot loader source to use new CMSIS packages 2016-12-19 16:54:59 -05:00
sam_ba_cdc.h [bl] Updating copyrights 2015-10-10 15:57:00 +02:00
sam_ba_monitor.c Remove warning 2016-09-22 15:48:41 +02:00
sam_ba_monitor.h Use SysTick for TX/RX LED pulsing 2016-09-22 15:48:39 +02:00
sam_ba_serial.c Correct baud rate value for UART 2016-02-03 14:58:57 -05:00
sam_ba_serial.h [bl] Updating copyrights 2015-10-10 15:57:00 +02:00
sam_ba_usb.c Fixed wrong adaption to CMSIS 4.5 in bootloader 2016-12-20 15:00:25 +01:00
sam_ba_usb.h Enable USB string descriptors in the bootloader 2016-09-22 16:18:17 +02:00
samd21_sam_ba.atsln [bl] Adding Atmel Studio 7 makefile based project, allowing debug 2015-10-06 17:36:29 +02:00
samd21_sam_ba.bin Merge remote-tracking branch 'upstream/master' 2017-01-15 17:17:21 -05:00
samd21_sam_ba.cproj [BL] Removing non used files from AS project 2015-10-30 10:50:16 +01:00
samd21_sam_ba.hex Updated bootloader binaries 2016-12-20 15:58:48 +01:00
samd21_sam_ba_genuino.bin Merge remote-tracking branch 'upstream/master' 2017-01-15 17:17:21 -05:00
samd21_sam_ba_genuino.hex Updated bootloader binaries 2016-12-20 15:58:48 +01:00

Arduino Zero Bootloader

1- Prerequisites

The project build is based on Makefile system. Makefile is present at project root and try to handle multi-platform cases.

Multi-plaform GCC is provided by ARM here: https://launchpad.net/gcc-arm-embedded/+download

Atmel Studio contains both make and ARM GCC toolchain. You don't need to install them in this specific use case.

For all builds and platforms you will need to have the Arduino IDE installed and the board support package for "Arduino SAMD Boards (32-bits ARM Cortex-M0+)". You can install the latter from the former's "Boards Manager" UI.

Windows

  • Native command line Make binary can be obtained here: http://gnuwin32.sourceforge.net/packages/make.htm

  • Cygwin/MSys/MSys2/Babun/etc... It is available natively in all distributions.

  • Atmel Studio An Atmel Studio 7 Makefile-based project is present at project root, just open samd21_sam_ba.atsln file in AS7.

Linux

Make is usually available by default.

OS X

Make is available through XCode package.

2- Selecting available SAM-BA interfaces

By default both USB and UART are made available, but this parameter can be modified in sam_ba_monitor.h, line 31:

Set the define SAM_BA_INTERFACE to

  • SAM_BA_UART_ONLY for only UART interface
  • SAM_BA_USBCDC_ONLY for only USB CDC interface
  • SAM_BA_BOTH_INTERFACES for enabling both the interfaces

3- Behaviour

This bootloader implements the double-tap on Reset button. By quickly pressing this button two times, the board will reset and stay in bootloader, waiting for communication on either USB or USART.

The USB port in use is the USB Native port, close to the Reset button. The USART in use is the one available on pins D0/D1, labelled respectively RX/TX. Communication parameters are a baudrate at 115200, 8bits of data, no parity and 1 stop bit (8N1).

4- Description

Pinmap

The following pins are used by the program : PA25 : input/output (USB DP) PA24 : input/output (USB DM) PA11 : input (USART RX) PA10 : output (USART TX)

The application board shall avoid driving the PA25, PA24, PB23 and PB22 signals while the boot program is running (after a POR for example).

Clock system

CPU runs at 48MHz from Generic Clock Generator 0 on DFLL48M.

Generic Clock Generator 1 is using external 32kHz oscillator and is the source of DFLL48M.

USB and USART are using Generic Clock Generator 0 also.

Memory Mapping

Bootloader code will be located at 0x0 and executed before any applicative code.

Applications compiled to be executed along with the bootloader will start at 0x2000 (see linker script bootloader_samd21x18.ld).

Before jumping to the application, the bootloader changes the VTOR register to use the interrupt vectors of the application @0x2000.<- not required as application code is taking care of this.

5- How to build

If not specified the makefile builds for Arduino Zero:

make

if you want to make a custom bootloader for a derivative board you must supply all the necessary information in a board_definitions_xxx.h file, and add the corresponding case in board_definitions.h. For example for the Arduino MKR1000 we use board_definitions_arduino_mkr1000.h and it is build with the following command:

BOARD_ID=arduino_mkr1000 NAME=samd21_sam_ba_arduino_mkr1000 make clean all