Building an Example
RIOT provides a number of examples in the examples/ directory. Every example
has a README that documents its usage and its purpose. You can build them by
opening a shell, navigating to an example (e.g. examples/basic/default), and
running:
make BOARD=samr21-xproor
make all BOARD=samr21-xproTo flash the application to a board just run:
make flash BOARD=samr21-xproYou can then access the board via the serial interface:
make term BOARD=samr21-xproIf you are using multiple boards you can use the PORT macro to specify the
serial interface:
make term BOARD=samr21-xpro PORT=/dev/ttyACM1For flashing and accessing the board via the serial interface, the current user needs to have the correct access rights on the serial device. The easiest way to ensure this is to add the current user to the group that is owning the serial device. For example, this can be achieved on Linux by issuing the following line, logging out and logging in again:
sudo usermod -aG $(stat --format="%G" /dev/ttyACM0) $USERWe use pyterm as the default terminal application. It is shipped with RIOT in
the dist/tools/pyterm/ directory. If you choose to use another terminal
program you can set TERMPROG (and if need be the TERMFLAGS) macros:
make -C examples/networking/gnrc/networking/ term \ BOARD=samr21-xpro \ TERMPROG=gtkterm \ TERMFLAGS="-s 115200 -p /dev/ttyACM0 -e"You may not see the greeting
main(): This is RIOT!when you flash the board. In this case, type reboot in the command line or reboot manually.