ArduinoCore-samd/bootloaders/zero
2019-03-08 14:03:54 -05:00
..
board_definitions.h Merge branch 'master' of https://github.com/arduino/ArduinoCore-samd into arduino-master 2019-03-08 14:03:54 -05: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 Make some USB product strings consistent 2017-11-30 10:10:57 -05:00
board_definitions_arduino_mkrgsm1400.h Make some USB product strings consistent 2017-11-30 10:10:57 -05:00
board_definitions_arduino_mkrnb1500.h Rename left over MKR NB-IoT 1500's to MKR NB 1500 2018-11-27 09:25:54 +01:00
board_definitions_arduino_mkrwan1300.h Make some USB product strings consistent 2017-11-30 10:10:57 -05:00
board_definitions_arduino_mkrwifi1010.h Add MKR WiFi1010 variant and bootloader 2018-07-04 12:03:43 +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_i2c.c Split PMIC and I2C functionality in boot loader to separate files 2017-11-29 13:49:54 +01:00
board_driver_i2c.h Split PMIC and I2C functionality in boot loader to separate files 2017-11-29 13:49:54 +01:00
board_driver_led.c reverts bootloaders/zero changes 2018-08-30 14:07:08 -04:00
board_driver_led.h reverts bootloaders/zero changes 2018-08-30 14:07:08 -04:00
board_driver_pmic.c Bump input current limit to 2A 2017-11-29 13:49:54 +01:00
board_driver_pmic.h Split PMIC and I2C functionality in boot loader to separate files 2017-11-29 13:49:54 +01:00
board_driver_serial.c [bl] Updating copyrights 2015-10-10 15:57:00 +02:00
board_driver_serial.h reverts bootloaders/zero changes 2018-08-30 14:07:08 -04:00
board_driver_usb.c reverts bootloaders/zero changes 2018-08-30 14:07:08 -04: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 reverts bootloaders/zero changes 2018-08-30 14:07:08 -04:00
bootloader_samd21x18.ld [bl] Fixing bug in jump to application 2015-10-10 15:48:15 +02:00
build_all_bootloaders.sh Rename left over MKR NB-IoT 1500's to MKR NB 1500 2018-11-27 09:25:54 +01:00
main.c reverts bootloaders/zero changes 2018-08-30 14:07:08 -04:00
main.h pulse D13 LED during bootloader active 2018-08-30 13:59:19 -04:00
Makefile reverts bootloaders/zero changes 2018-08-30 14:07:08 -04:00
README.md reverts bootloaders/zero changes 2018-08-30 14:07:08 -04:00
sam_ba_cdc.c reverts bootloaders/zero changes 2018-08-30 14:07:08 -04:00
sam_ba_cdc.h [bl] Updating copyrights 2015-10-10 15:57:00 +02:00
sam_ba_monitor.c reverts bootloaders/zero changes 2018-08-30 14:07:08 -04:00
sam_ba_monitor.h Use SysTick for TX/RX LED pulsing 2016-09-22 15:48:39 +02:00
sam_ba_serial.c reverts bootloaders/zero changes 2018-08-30 14:07:08 -04:00
sam_ba_serial.h [bl] Updating copyrights 2015-10-10 15:57:00 +02:00
sam_ba_usb.c reverts bootloaders/zero changes 2018-08-30 14:07:08 -04:00
sam_ba_usb.h reverts bootloaders/zero changes 2018-08-30 14:07:08 -04: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 unknown change but commiting anyhow (we dont use the files) 2018-08-30 14:24:33 -04:00
samd21_sam_ba.cproj [BL] Removing non used files from AS project 2015-10-30 10:50:16 +01:00
samd21_sam_ba.elf reverts bootloaders/zero changes 2018-08-30 14:07:08 -04:00
samd21_sam_ba.hex reverts bootloaders/zero changes 2018-08-30 14:07:08 -04:00
samd21_sam_ba_genuino.bin unknown change but commiting anyhow (we dont use the files) 2018-08-30 14:24:33 -04:00
samd21_sam_ba_genuino.hex reverts bootloaders/zero changes 2018-08-30 14:07:08 -04: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.

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.