RIOT OS Gpio Example

1.1k Views Asked by At

I have to work with RIOT OS and currently I'm testing out how everything works (or not work).

Info: RIOT OS is a IOT OS which run on mircocontrollers and arms.

I develop under Debian with Eclispe, the develop environment was setup after the GitHub Guide from RIOT. The Guide

The hello world example works for me without problems. Now I want to load some of the RIOT modules and then I get errors.

That's what I did so far.

  1. I created a new folder for my project, copy the hello-world example and adjust the makefile.
  2. Then I adjust the riot project properties like in the guide, just for my example.
  3. Created the new symbol and include xml and imported them.
  4. Re-indexed the riot project
  5. Changed the basic hello world code with my example code.
  6. Try to build it....

This is my example main, it doesn't do much, just init a gpio pin.

#include <stdio.h>
#include "periph/gpio.h"

int main(void)
{
    gpio_t pin = GPIO(1,22);
    gpio_init(pin,GPIO_OUT);

    return 0;
}

And this is the makefile for it

# name of your application
APPLICATION = test

# If no BOARD is found in the environment, use this default:
BOARD ?= nucleo-f303

# This has to be the absolute path to the RIOT base directory:
RIOTBASE ?= $(CURDIR)/../..

# Comment this out to disable code in RIOT that does safety checking
# which is not needed in a production environment but helps in the
# development process:
DEVELHELP ?= 1

# Change this to 0 show compiler invocation lines by default:
QUIET ?= 1

FEATURES_REQUIRED = periph_gpio

include $(RIOTBASE)/Makefile.include

By building the project I get following errors:

enter image description here

In english it would be something like:
- the rule for target "path" failed.
- the rule for target "link" failed.
- make: [link] error 2
- make(1): ["path/main.o"] error 1

This is the part in the riot makefile where the error happen. Its exactly the same in both file (Makefile.include and Makefile.base).

enter image description here

I hope anybody can me explain what I did wrong or where are my mistakes.

EDIT:

The problem was GPIO() was wrong... its called GPIO_PIN() thats cause the error.

0

There are 0 best solutions below