class: center, middle, riot
Raphael Hiesgen, Peter Kietzmann, Sebastian Meiling, Thomas C. Schmidt
iNET, Department Informatik, HAW Hamburg
- Code: https://github.com/RIOT-OS/RIOT
- Wiki: https://github.com/RIOT-OS/RIOT/wiki
- Mailing List: [email protected]
- IRC: irc.freenode.org #riot-osv
- Use a PC in the LAB
- OR setup your own development environment
The vagrant image created by RIOT already includes most compilers and tools for flashing.
- Open a terminal
- Get the code & switch to your branch
$ git clone https://github.com/USERNAME/RIOT.git
$ cd RIOT
$ git checkout <working_branch>
- Start vagrant
$ vagrant up
$ vagrant ssh
- Compile and flash an example
$ cd RIOT/examples/hello-world
$ # Connect a Atmel SAM R21 Xplained Pro board via USB
$ BOARD=samr21-xpro make all flash term
- Press the reset button on the board
- You should see a
Hello World!
message - Congratulations, you just flashed your first RIOT application! :-)
- Copy the
hello-world
files to your project folder - Edit
main.c
and add new includes ...
#include "board.h"
#include "xtimer.h"
- ... and code for the LEDs
for(int i = 0; i < 10; i++) {
puts("LED on");
LED_RED_ON;
xtimer_sleep(1);
puts("LED off");
LED_RED_OFF;
xtimer_sleep(1);
}
- Rename you application
APPLICATION = my_project
- Include the xtimer module
USEMODULE += xtimer
- Sync your project folder using the VirtualBox UI OR via the
Vagrantfile
in RIOT
config.vm.synced_folder ".", "/home/vagrant/RIOT"
# Add this line to sync your PROJECT folder to /home/vagrant/PROJECT
config.vm.synced_folder "/path/to/PROJECT", "/home/vagrant/PROJECT"
- Reload and connect to vagrant
$ vagrant reload && vagrant ssh
- Compile and flash your project
$ cd your/project
$ BOARD=samr21-xpro make all flash term
- In addition to the message, you should see a blining LED
- Set your name and email
$ git config --global user.email "[email protected]"
$ git config --global user.name "Your Name"
- Look at your changes
$ git status
- Add, commit and push files
$ git add FILE_1 FILE_2
$ git commit
$ git push
- Reset an uncommited file to the upstream
$ git checkout FILE
- RIOT regularly receives updates in form of pull requests.
- To update your fork:
- update your master branch
- rebase your working branch to your master.
$ git checkout master
$ git pull https://github.com/RIOT-OS/RIOT.git
$ git checkout <working_branch>
$ git rebase master
There are various sites online that explain git. Here are a few we like:
- https://git-scm.com/doc
- http://githowto.com/
- https://training.github.com/kit/downloads/github-git-cheat-sheet.pdf
- http://www.learnenough.com/git-tutorial