HSSV ATSAMR21 Breakout English

De Wiki Hackerspace San Salvador
Ir a la navegación Ir a la búsqueda

Welcome to the official page for the ATSAMR21 breakout board by Hackerspace San Salvador!

Para información en español, por favor seguir este vínculo: HSSV_ATSAMR21_Breakout.

This board is designed for use with RIOT OS. (With a little bit of work you could use it with Arduino)

Board specifications[editar]

The breakout board uses the module ATSAMR21G18A-MR210UA. This module combines the ATSAMR21G18, a 4Mb Flash memory AT45DB041E and a crypto-authentication chip ATECC508A.

This breakout board also includes a power-path/LiPo charge management unit MCP73871 and a very low dropout 3.3V regulator LD3985M33R.

The whole system has the following characteristics:

  • 32 bits ARM Cortex M0+ microcontroller
  • 2.4GHz low-power transceiver for IEEE 802.15.4 + ZigBee
  • 256KB Flash
  • Maximum operating frecuency of 48MHz
  • Integrated temperature sensor
  • 4Mb external Flash memory
  • Cryto chip with: Secure key storage, high-speed public-key algorithms, elliptic curves support (NIST P256), SHA-256, unique serial number, high-quality RNG.
  • Pre-set MAC address

Design files for this board are available over GitHub.

How to get one of this boards?[editar]

For now we have a very small development batch. If you are interested in collaborate on the development send us an email to with your address. We will include you in the developer list and you'll receive a new development board at a fraction of the cost.

If you are interested to build this board by yourself, please use this resources:

  1. Order your board at OSHPark
  2. Get the components on Mouser
  3. Recommended: Generate the stencils with the eagle design files with OSHStencils
  4. Load the bootloader with the instructions over HSSV_ATSAMR21_Breakout_English#Flashing_BOSSA_bootloader


ATSAMR21 Breakout.PNG

Starting the board for the first time[editar]

To start the board for the first time you will need a micro-USB cable. Boards are pre-loaded with the bossa bootloader (Used by Arduino) with the command line tool bossac.

If you assambled the board by yourself. You will also need a JTAG programmer.

On this page you will find instructions for both procedures.

Important notice: At this time is only possible to control RIOT using an external serial port. We hope to have USB-CDC support soon, meanwhile you will need a USB-Serial converter.

Hardware requirements[editar]

To start your board for the first time you'll need the following components:

  • Micro-USB Cable
  • USB-Serial FTDI converter (or equivalent) with logic levels of 3.3V
  • Optional: JTAG Programmer. You can use the ARM-USB-Tiny (remember to buy the adapter board for SWD).

Connect the FTDI convertert to the TX y RX pins as shown in the image:

USB-Serial Connection.jpg

Software requirements[editar]

If your board already includes a bootloader:

If your board doesn't includes a bootloader:

  • A recent version of OpenOCD

Load RIOT-OS with the bootloader[editar]

Connect your board with an USB cable.

Clone the RIOT repository from Hackerspace San Salvador with the following command:

git clone https://github.com/hackerspacesv/RIOT

Change to the examples directory:

cd RIOT/examples/gnrc_networking

Compile the example specifying the breakout board:

make BOARD=hssv-atsamr21-breakout

Execute the following command to flash the board:

make flash BOARD=hssv-atsamr21-breakout

Open a terminal client with the following command (We assume minicom and the serial device /dev/ttyUSB0):

minicom -b 115200 -D /dev/ttyUSB0

If you press the reset button you'll see a message as the following:

main(): This is RIOT! (...Versión e info de compilación...)
RIOT Network stack example application
All up, running the shell now

Flashing BOSSA bootloader[editar]

Bossa is the bootloader used in Arduino boards based on the ATSAMD. We have made a couple of changes to make it available for this development board. If you have assembled your board or if you received one without a bootloader and you cannot load your firmware, use this procedure to flash the bootloader.

Important: To flash the bootloader Bossa you will need a JTAG programmer (We recommend the cheap Olimex ARM-USB-TINY) and a SWD adapter and cable. You can see all the required components on this picture:


Now connect the ATSAMR21 breakout board to an USB port on your computer. After that connect the JTAG programmer as shown in the picture:

SAMR21 Breakout w JTAG Programmer.jpg

Clone our ArduinoCore-samd port:

git clone https://github.com/hackerspacesv/ArduinoCore-samd

Change to the ATSAMR21 Breakout bootloader directory:

cd ArduinoCore-samd/bootloaders/HSSV_SAMR21_Mote/

With the ARM-USB-TINY connected execute the following command:

openocd -f interface/ftdi/olimex-jtag-tiny.cfg -f interface/ftdi/olimex-arm-jtag-swd.cfg -f target/at91samdXX.cfg

It should show a message like this:

Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 400 kHz
Info : SWD DPIDR 0x0bc11477
Info : at91samd.cpu: hardware has 4 breakpoints, 2 watchpoints
Info : Listening on port 3333 for gdb connections

Open a new terminal and execute the following command:

telnet 4444

It should show you a message like this:

Connected to
Escape character is '^]'.
Open On-Chip Debugger

Write the following commands:

reset halt
flash write_image erase samr21_sam_ba_HSSV_SAMR21_Mote.bin

You can confirm a successful flash looking for the following message:

auto erase enabled
wrote 6400 bytes from file samr21_sam_ba_HSSV_SAMR21_Mote.bin in 0.451532s (13.842 KiB/s)

If you look at /var/log/messages you should see a message like this:

usb 2-1.4: new full-speed USB device number 8 using xhci_hcd
usb 2-1.4: New USB device found, idVendor=1209, idProduct=053a, bcdDevice= 2.00
usb 2-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 2-1.4: Product: HSSV SAMR21-Mote
usb 2-1.4: Manufacturer: Hackerspace San Salvador
cdc_acm 2-1.4:1.0: ttyACM0: USB ACM device

If you are using a systemd based distribution, run the following command:

lsusb | grep InterBiometrics

Verify that the following line appears:

Bus 002 Device 008: ID 1209:053a InterBiometrics