• Keine Ergebnisse gefunden

Bachelor PO - SmartUniversity

N/A
N/A
Protected

Academic year: 2022

Aktie "Bachelor PO - SmartUniversity"

Copied!
16
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Bachelor PO - SmartUniversity

Hochschule für Angewandte Wissenschaften Hamburg

Application Example

(2)

Important Links

Code: https://github.com/RIOT-OS/RIOT

Wiki: https://github.com/RIOT-OS/RIOT/wiki

Mailing List: devel@riot-os.org

IRC: irc.freenode.org #riot-os

(3)

First Steps

Get a GitHub account: https://github.com

Fork the RIOT repository:

https://help.github.com/articles/fork-a-repo/

RIOT & Git Cheatsheet https://github.com/RIOT-OS/RIOT/wiki/Git- cheatsheet

(4)

Development Environment

1. Use a PC and in the Lab with a prepared VM

2. Or setup your own Linux develop environment (recommended!)

Tools: git, gcc toolchain for arm, OpenOCD

Wiki entries that can help you:

https://github.com/RIOT-OS/RIOT/wiki/Getting- started-with-STM32F

%5B0%7C3%7C4%5Ddiscovery-boards

https://github.com/RIOT-OS/RIOT/wiki/OpenOCD

(5)

Lab VMs

Start the VM located on the USB drive 1. Open Oracle VM VirtualBox

2. Click on Machine/Add and select the image 3. E:\PO_SMD

\LUbuntu_RIOT_PO_2015\LUbuntu_RIOT_P O_2015.vbox

4. Start the VM

User: RIOT-OS-Devel, PW: riot

(6)

Open a terminal

Get the code and switch folders

$ git clone https://github.com/USER_NAME/RIOT.git

$ cd RIOT

Create a branch and check if it worked

$ git checkout -b YOUR_BRANCH_NAME

$ git branch

Get the Code

(7)

Go to RIOT/examples/ and create a new folder

$ cd examples

$ mkdir my_first_project

$ cd my_first_project

Copy Makefile and main.c from the hello-world example

$ cp ../hello_world/Makefile .

$ cp ../hello_world/main.c .

Your First RIOT Program

(8)

New includes

#include "board.h"

#include "xtimer.h"

A code snippet 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);

}

Adjust main.c

(9)

Rename the application

APPLICATION = my_first_project

Include the xtimer module

USEMODULE += xtimer

Adjust the Makefile

(10)

Prepare the Compiler

Add the bin folder of the arm compiler to your PATH

$ export PATH=$PATH:/*path*/*to*/gcc-arm-none- eabi-*version*/bin

Check if it worked (prints compiler version)

$ arm-none-eabi-gcc -v

(11)

Build application for your target device

Atmel SAM R21 Explained Pro: samr21-xpro

Physic phyWAVE KW22: pba-d-01-kw2x

$ BOARD=*board_name* make

Flash your binary

$ BOARD=*board_name* make flash

Open a serial connection

$ sudo BOARD=*board_name* make term

Compile Your Code

(12)

Flashing from the VM

Windows driver should be installed automatically

Connect the USB device to the VM

Click Geräte/USB/*device* EDBG CMSIS-DAP

Or a similar name …

Now, flashing should work from your VM

(13)

Exceptions for Atmel

Use a Windows terminal emulation for the serial output

Disconnect device from the VM

Find the connected COM port

(Systemsteuerung/Geräte-Manager)

Start Tera Term (on the USB drive E:\PO_SMD)

Tera Term is preconfigured

Adapt the COM port (Setup/Serial port/Port)

(14)

Application Output

Press the reset button on the board

You should see

A << Hello World >> message

A blinking LED

Congratulations! You just build your first RIOT application :-)

(15)

Look at your changed files

$ git status

Add and commit files

$ git add main.c Makefile

$ git commit

Push changes to GitHub

$ git push

Track Changes with GIT

Note : The first time you'll try to commit your changes, you need to set up git on the machine by entering your account data : $ git config --global user.email "you@example.com"

$ git config --global user.name "Your Name"

(16)

www.riot-os.org

Referenzen

ÄHNLICHE DOKUMENTE

ferner definiert das verfahren, ob die vergütung einstufig erfolgt und die Leistungserbringer direkt das geld von den krankenkassen erhalten (wie bei den krankenhäusern oder

Konnte im Abgleich aus Bedarf und Angebot eine bedarfs- gerechte Versorgungssituation ermittelt werden (Leistungen, die zwar für eine bedarfsgerechte Versorgung der Bevölke-

hierzu ist auch eine genaue Bewertung der (zukünftigen) hausärztlichen Versor- gung notwendig, um abschätzen zu können, in welchem umfang durch die PoRT-struktur

Our findings are discussed, focussing on five themes: (1) formalized planning versus ad hoc investment decisions, (2) the types and time horizons of port planning documents,

Das mySTM32 Board light verzichtet auf jeglichen Komfort anderer myMCU Boards und enthält nur die nötigsten Elemente, welche für das Lernen mit dem Board benötigt werden..

All such repairs and/or replacements shall be rendered by Solid State Music without charge for parts or labor when the product is returned within the specified

Decision-makers of the Gulf Cooperation Council (GCC) states need to deliver solutions for shaping new cities—cities that can safeguard the environment while being economically

Additional interviews conducted four to six months after the event, when port recovery primarily involved rebuilding and hardening shore-side infra- structure, corroborated