-
Notifications
You must be signed in to change notification settings - Fork 1
Board: SAMR21 xpro
The SAMR21 Xplained Pro
is a compact evaluation board by Atmel featuring a ATSAMR21G18A SoC. The SoC includes a SAMD21 ARM Cortex-M0+ micro-controller bundled with Atmel's AT86RF233, a 2.4GHz IEEE802.15.4 compatible radio. For programming the MCU comes with 32Kb of RAM and 256Kb of flash memory.
The samr21-xpro is available from various hardware vendors for ~40EUR (as of sep. 2014).
MCU | ATSAMR21G18A |
---|---|
Family | ARM Cortex-M0+ |
Vendor | Atmel |
RAM | 32Kb |
Flash | 256Kb |
Frequency | up to 48MHz |
FPU | no |
Timers | 6 (1x 16-bit, 2x 24-bit, 3x 32-bit) |
ADCs | 1x 12-bit (8 channels) |
UARTs | max 5 (shared with SPI and I2C) |
SPIs | max 5 (see UART) |
I2Cs | max 5 (see UART) |
Vcc | 1.8V - 3.6V |
Datasheet | Datasheet |
Board Manual | Board Manual |
1 User button and 1 LED:
Device | PIN |
---|---|
LED0 | PA19 |
SW0 (button) | PA28 |
The SAMR21 SoC includes an on-chip AT86RF233 radio. It is internally connected via SPI and some GPIO pins and behaves in exact the same way as externally connected SPI devices.
Sensor | AT86RF233 |
---|---|
Type | 2.4GHz IEEE802.15.4 radio |
Vendor | Atmel |
Datasheet | Datasheet |
Connected to | SPI_0 |
Pin Config: | |
Device | SERCOM4 |
MOSI | PB30 (OUT, SPI mosi) |
MISO | PC19 (IN, SPI miso) |
SCLK | PC18 (OUT, SPI sclk) |
CS | PB31 (OUT, GPIO output) |
IRQ | PB00 (IN, GPIO external interrupt) |
RSTN | PB15 (OUT, GPIO output) |
SLP_TR | PA20 (OUT, GPIO output) |
Please refer to this tracker to see which projects are work in progress and who is the contact person for this.
Device | ID | Supported | Comments |
---|---|---|---|
MCU | samd21 | partly | Energy saving modes not fully utilized |
Low-level driver | GPIO | yes | |
PWM | no | ||
UART | yes | two UARTs by now | |
I2C | yes | ||
SPI | yes | ||
ADC | yes | PA04 & PA05 disabled by default due to EDBG's use of them for UART, can be enabled from periph_conf.h
|
|
USB | no | ||
RTT | yes | ||
RTC | yes | ||
RNG | no | no HW module | |
Timer | yes | ||
Radio Chip | AT86RF233 | yes | using at86rf231 driver (this will be renamed to at86rf2xx) |
Connect the device to your Micro-USB cable using the port labeled as EDBG.
The standard method for flashing RIOT to the samr21-xpro is using OpenOCD. For this to work properly, you have to make sure to use a very recent version of OpenOCD. The v0.8.0 release will not work. If this is still the current release you'll have to build OpenOCD from source.
Refer to https://github.com/RIOT-OS/RIOT/wiki/OpenOCD for building OpenOCD and make sure "cmsis-dap" and "hidapi-libusb" are enabled.
On Linux you will have to add a udev rule for hidraw, like
echo 'KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0664", GROUP="plugdev"' \
| sudo tee -a /etc/udev/rules.d/99-usb.rules
sudo service udev restart
With yaourt:
yaourt -S hidapi-git
yaourt -S openocd-git
# edit PKGBUILD, make sure "hidapi-libusb" is in "_features"
The udev rules for Arch differ a little from the example given above:
echo 'KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0664", GROUP="uucp"' \
| sudo tee -a /etc/udev/rules.d/99-usb.rules
sudo udevadm control --reload
See http://watr.li/samr21-dev-setup-ubuntu.html
If you have multiple boards connected to the same computer and want to flash, this is what you can do:
First, run make list-ttys
. This will show you a list of currently connected boards, their serial numbers and the names of their TTYs:
Atmel Corp. EDBG CMSIS-DAP serial: 'ATML2127031800002124', tty(s): ttyACM0
Atmel Corp. EDBG CMSIS-DAP serial: 'ATML2127031800002145', tty(s): ttyACM1
knowing your serial number, you can flash, open a terminal or debug a specific board like this:
BOARD=samr21-xpro SERIAL="ATML2127031800002124" make flash
BOARD=samr21-xpro SERIAL="ATML2127031800002124" make term
BOARD=samr21-xpro SERIAL="ATML2127031800002124" make debug
For using the samr21-xpro board we strongly recommend the usage of the GNU Tools for ARM Embedded Processors toolchain.
When connecting an I2C device and a logic analyzer to an I2C port at the same time, the internal pull-up resistors are not sufficient for stable bus operation. You probably have to connect external pull-ups to both bus lines. 10K is a good value to start with.
The default stack sizes have not been tuned properly yet. If in doubt why your application crashes try increasing the default stack sizes and use ps
to find out how much stack is being used.
Tracked in https://github.com/RIOT-OS/RIOT/issues/2228
When using the SW0 user button as interrupt source it appears that this is triggered when just tipping on the button and not really pressing it.
It can happen that OpenOCD is not able to program the board, because of wrong clock configuration or low power modes. In this case you can use this little tool to erase the flash. Just follow the instructions to build it and run ./edbg -e
to erase the flash. Then press the reset button and you're able to program via OpenOCD again.
It might happen that flashing through OpenOCD works once inside Virtual Box. But when you try to flash again, you could get a CMSIS-DAP related error. It seems to only happen with USB 3.0 ports. You can take a look at Vagrant and use a virtual Linux to run the virtual RIOT, and flash from OS X.
RIOT - The friendly Operating System for the Internet of Things
Homepage | [GitHub] (https://github.com/RIOT-OS/) | Developers Mailing List | Users Mailing List | Twitter @RIOT_OS
- Family: ARM
- Board: Airfy Beacon
- Board: Arduino Due
- Board: CC2538DK
- Board: CC2650STK
- Board: HikoB Fox
- Board: IoT LAB M3
- Board: LimiFrog-v1
- Board: mbed_lpc1768
- Board: MSB-IoT
- Board: MSBA2
- Board: Nucleo-L1
- Board: Nucleo-F334
- Board: Nucleo-F303
- Board: Nucleo-F091
- Board: Mulle
- Board: OpenMote
- Board: PCA1000x (nRF51822 Development Kit)
- Board: Phytec phyWAVE-KW22
- Board: RFduino
- Board: SAMR21-xpro
- Board: SAML21-xpro
- Board: Spark Core
- Board: STM32F0discovery
- Board: STM32F3discovery
- Board: STM32F4discovery
- Board: UDOO
- Board: yunjia-nrf51822
- Board: Zolertia remote
- Family: ATmega
- Board: Arduino Mega2560
- Family: MSP430
- Board: MSB-430H
- Board: TelosB
- Board: WSN430
- Board: Zolertia Z1
- Board: eZ430-Chronos
- Family: native
- Board: native
- Family: x86
- Board: Intel Galileo