RIOT-OS and SAMR21-xpro
Sources/Links:
- RIOT-OS Setup: https://wiki.elvis.science/index.php?title=Riot-OS_Setup
- SAMR21-xpro User Guide: ww1.microchip.com/downloads/en/DeviceDoc/Atmel-42243-SAMR21-Xplained-Pro_User-Guide.pdf
- SAMR21-xpro Data Sheet: https://ww1.microchip.com/downloads/en/DeviceDoc/SAM-R21_Datasheet.pdf
Operating system used on laptop/computer: Debian/Ubuntu Linux
- Install necessary packages:
sudo apt install git openocd gcc-multilib build-essential python-serial libudev-dev
-
Download GNU Arm Embedded Toolchain: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm
- CoMatrix was tested with:
GNU Arm Embedded Toolchain 9-2020-q2-update
- CoMatrix was tested with:
-
Unzip the downloaded file:
tar -xjvf gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2
- Add toolchain to PATH:
export PATH=$PATH:<path to unzipped folder>/gcc-arm-none-eabi-9-2020-q2-update/bin
- Add toolchain permanently to PATH (otherwise it’s necessary to do it manually after every restart):
vim ~/.profile
and/or vim ~/.bashrc
- Add the following line to the bottom and save:
export PATH=$PATH:<path to unzipped folder>/gcc-arm-none-eabi-9-2020-q2-update/bin
- Apply changes for current shell:
source ~/.profile
source ~/.bashrc
- Download RIOT-OS:
git clone https://github.com/RIOT-OS/RIOT.git
- Set the rights for your user to be able to flash applications on the board:
sudo usermod -a -G dialout <username>
- Connect the SAMR21-xpro board to your laptop/computer via micro USB cable (USB EDBG interface):
- Test building and flashing an application (to SAMR21-xpro) with the provided
hello-world
example:
cd RIOT/examples/hello-world
make BOARD=samr21-xpro
make BOARD=samr21-xpro flash
- Connect to SAMR21-xpro via term:
make BOARD=samr21-xpro term
- Or via
pyterm
(which is shipped with RIOT-OS):
sudo pip3 install pyserial
cd RIOT/dist/tools/pyterm
./pyterm -p /dev/ttyACM0
- To find out the correct
tty
:
$ cd RIOT/examples/hello-world
$ make list-ttys
/sys/bus/usb/devices/1-3: Atmel Corp. EDBG CMSIS-DAP, serial: 'ATMLXXXXXXX80000XXX1', tty(s): ttyACM0
/sys/bus/usb/devices/1-2: Atmel Corp. EDBG CMSIS-DAP, serial: 'ATMLXXXXXXX80000XXX2', tty(s): ttyACM1
- If you have multiple boards connected to your computer it is necessary to provide the serial during flashing:
BOARD=samr21-xpro SERIAL="ATMLXXXXXXX80000XXX1" make flash