Skip to content
Branch: master
Find file History
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
Makefile Make CDC/UART interface configurable from Makefile Aug 29, 2018
README.md Bootloader makefile has been refactored for easier customization Sep 22, 2016
board_definitions.h Merge branch 'mkrwan1310' into beta Apr 29, 2019
board_definitions_arduino_mkr1000.h bootloader: use correct SERCOMx_GCLK definition from CMSIS Dec 7, 2016
board_definitions_arduino_mkrfox1200.h Make some USB product strings consistent Nov 30, 2017
board_definitions_arduino_mkrgsm1400.h Make some USB product strings consistent Nov 30, 2017
board_definitions_arduino_mkrnb1500.h Rename left over MKR NB-IoT 1500's to MKR NB 1500 Nov 27, 2018
board_definitions_arduino_mkrvidor4000.h Add 10ms delay at start of double detector for boards with EZ6301QI t… Aug 29, 2018
board_definitions_arduino_mkrwan1300.h Make some USB product strings consistent Nov 30, 2017
board_definitions_arduino_mkrwan1310.h MKRWAN1310: start integration Apr 19, 2019
board_definitions_arduino_mkrwifi1010.h Add MKR WiFi1010 variant and bootloader Jul 4, 2018
board_definitions_arduino_mkrzero.h Added support for MKRZero Dec 7, 2016
board_definitions_arduino_nano_33_iot.h Rename NONA_WLAN in NANO 33 IoT Apr 19, 2019
board_definitions_arduino_zero.h bootloader: use correct SERCOMx_GCLK definition from CMSIS Dec 7, 2016
board_definitions_genuino_mkr1000.h bootloader: use correct SERCOMx_GCLK definition from CMSIS Dec 7, 2016
board_definitions_genuino_zero.h bootloader: use correct SERCOMx_GCLK definition from CMSIS Dec 7, 2016
board_driver_i2c.c [VIDORBL] Add timeouts to i2c operations Aug 29, 2018
board_driver_i2c.h Split PMIC and I2C functionality in boot loader to separate files Nov 29, 2017
board_driver_jtag.c Add retry count when waiting for JTAG response Aug 29, 2018
board_driver_jtag.h Check bitstream version before reloading, also check + reload before … Aug 29, 2018
board_driver_led.c Move SysTick_Handler to main.c and create LED_pulse function Sep 22, 2016
board_driver_led.h Bootloader LEDs are now optional Sep 22, 2016
board_driver_pmic.c [VIDORBL] Add timeouts to i2c operations Aug 29, 2018
board_driver_pmic.h [VIDORBL] Add timeouts to i2c operations Aug 29, 2018
board_driver_serial.c Make CDC/UART interface configurable from Makefile Aug 29, 2018
board_driver_serial.h bootloader: use correct SERCOMx_GCLK definition from CMSIS Dec 7, 2016
board_driver_usb.c Make CDC/UART interface configurable from Makefile Aug 29, 2018
board_driver_usb.h [bl] Updating copyrights Oct 10, 2015
board_init.c BL: borrow system_init from uf2 Apr 19, 2019
board_startup.c TEST: start porting jtag to bootloader Aug 29, 2018
bootloader_samd21x18.ld [bl] Fixing bug in jump to application Oct 10, 2015
build_all_bootloaders.sh Merge branch 'mkrwan1310' into beta Apr 29, 2019
main.c Add 10ms delay at start of double detector for boards with EZ6301QI t… Aug 29, 2018
sam_ba_cdc.c Update boot loader source to use new CMSIS packages Dec 19, 2016
sam_ba_cdc.h [bl] Updating copyrights Oct 10, 2015
sam_ba_monitor.c [bootloader] fail fast if JTAG init fails Aug 29, 2018
sam_ba_monitor.h Make CDC/UART interface configurable from Makefile Aug 29, 2018
sam_ba_serial.c Make CDC/UART interface configurable from Makefile Aug 29, 2018
sam_ba_serial.h [bl] Updating copyrights Oct 10, 2015
sam_ba_usb.c [bootloader] Allow current USB current values Aug 29, 2018
sam_ba_usb.h Enable USB string descriptors in the bootloader Sep 22, 2016
samd21_sam_ba.atsln [bl] Adding Atmel Studio 7 makefile based project, allowing debug Oct 6, 2015
samd21_sam_ba.bin Rebuild all bootloaders Apr 19, 2019
samd21_sam_ba.cproj [BL] Removing non used files from AS project Oct 30, 2015
samd21_sam_ba.hex Rebuild all bootloaders Apr 19, 2019
samd21_sam_ba_genuino.bin Rebuild all bootloaders Apr 19, 2019
samd21_sam_ba_genuino.hex Rebuild all bootloaders Apr 19, 2019

README.md

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
You can’t perform that action at this time.