ArduinoCore-samd/bootloaders/metroM4
2018-08-30 15:13:57 -04:00
..
board_definitions.h DM: adding feather m4 2018-08-30 14:58:44 -04:00
board_definitions_feather_m4.h DM: updated magic number to match circuitpython stuff 2018-08-30 14:59:48 -04:00
board_definitions_metro_m4.h DM: updated magic number to match circuitpython stuff 2018-08-30 14:59:48 -04:00
board_driver_led.c DM: added metro m4 variant 2018-08-30 14:51:09 -04:00
board_driver_led.h DM: added metro m4 variant 2018-08-30 14:51:09 -04:00
board_driver_serial.c DM: added metro m4 variant 2018-08-30 14:51:09 -04:00
board_driver_serial.h DM: added metro m4 variant 2018-08-30 14:51:09 -04:00
board_driver_usb.c DM: added metro m4 variant 2018-08-30 14:51:09 -04:00
board_driver_usb.h DM: added metro m4 variant 2018-08-30 14:51:09 -04:00
board_init.c DM: fixed USB enumeration bug in bootloader and core 2018-08-30 14:56:11 -04:00
board_startup.c DM: added metro m4 variant 2018-08-30 14:51:09 -04:00
bootloader-metro_m4-v2.0.0-adafruit.5.bin DM: add bootloaders 2018-08-30 15:13:57 -04:00
bootloader-metro_m4-v2.0.0-adafruit.5.elf DM: add bootloaders 2018-08-30 15:13:57 -04:00
bootloader_FEATHER_M4.ld DM: update m4 bootloader for multiple targets 2018-08-30 14:58:45 -04:00
bootloader_METRO_M4.ld DM: updates for rev B 2018-08-30 14:59:16 -04:00
build_all_bootloaders.sh DM: added metro m4 variant 2018-08-30 14:51:09 -04:00
main.c DM: updated magic number to match circuitpython stuff 2018-08-30 14:59:48 -04:00
Makefile DM: updates for rev B 2018-08-30 14:59:16 -04:00
METRO_M4_sam_ba.bin DM: updated magic number to match circuitpython stuff 2018-08-30 14:59:48 -04:00
METRO_M4_sam_ba.elf DM: updated magic number to match circuitpython stuff 2018-08-30 14:59:48 -04:00
METRO_M4_sam_ba.hex DM: updated magic number to match circuitpython stuff 2018-08-30 14:59:48 -04:00
README.md DM: added metro m4 variant 2018-08-30 14:51:09 -04:00
sam_ba_cdc.c DM: added metro m4 variant 2018-08-30 14:51:09 -04:00
sam_ba_cdc.h DM: added metro m4 variant 2018-08-30 14:51:09 -04:00
sam_ba_monitor.c DM: added metro m4 variant 2018-08-30 14:51:09 -04:00
sam_ba_monitor.h DM: added metro m4 variant 2018-08-30 14:51:09 -04:00
sam_ba_serial.c DM: added metro m4 variant 2018-08-30 14:51:09 -04:00
sam_ba_serial.h DM: added metro m4 variant 2018-08-30 14:51:09 -04:00
sam_ba_usb.c DM: added metro m4 variant 2018-08-30 14:51:09 -04:00
sam_ba_usb.h DM: added metro m4 variant 2018-08-30 14:51:09 -04:00
samd51_sam_ba.componentinfo.xml DM: updated bootloader size to 16k, fixed USB vid/pid 2018-08-30 14:55:41 -04:00
samd51_sam_ba.cproj DM: fix upload bug 2018-08-30 14:59:16 -04:00
samdx1_sam_ba.atsln DM: update m4 bootloader for multiple targets 2018-08-30 14:58:45 -04:00
update-bootloader-metro_m4-v2.0.0-adafruit.5.uf2 DM: add bootloaders 2018-08-30 15:13:57 -04:00

Metro M4 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)

PA23 : input (USART RX) PA22 : 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_samdx1.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 Metro M4:

make