我必须使用 RIOT OS,目前我正在测试一切如何工作(或不工作)。
信息:RIOT OS 是一个在微控制器和手臂上运行的物联网操作系统。
我在 Debian 下使用 Eclispe 进行开发,开发环境是在 RIOT 的 GitHub 指南之后设置的。导游
hello world 示例对我有用,没有问题。现在我想加载一些 RIOT 模块,然后我得到错误。
这就是我到目前为止所做的。
- 我为我的项目创建了一个新文件夹,复制 hello-world 示例并调整 makefile。
- 然后我像在指南中一样调整 riot 项目属性,仅用于我的示例。
- 创建新符号并包含 xml 并导入它们。
- 重新索引防暴项目
- 用我的示例代码更改了基本的 hello world 代码。
- 尝试构建它....
这是我的主要示例,它并没有做太多,只是初始化一个 gpio 引脚。
#include <stdio.h>
#include "periph/gpio.h"
int main(void)
{
gpio_t pin = GPIO(1,22);
gpio_init(pin,GPIO_OUT);
return 0;
}
这是它的makefile
# 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
通过构建项目,我得到以下错误:
在英语中,它类似于:
- 目标“路径”的规则失败。
- 目标“链接”的规则失败。
- make: [link] 错误 2
- make(1): ["path/main.o"] 错误 1
这是 riot makefile 中发生错误的部分。它在两个文件(Makefile.include 和 Makefile.base)中完全相同。
我希望任何人都可以解释我做错了什么或我的错误在哪里。
编辑:
问题是 GPIO() 错误……它称为 GPIO_PIN() 导致错误。