gpt4 book ai didi

api - RISCV C至UART的十六进制编译

转载 作者:行者123 更新时间:2023-12-02 10:56:09 29 4
gpt4 key购买 nike

我正在尝试将UART回送程序转换为相应的十六进制代码。命令

riscv32-unknown-elf-gcc test.c -march=rv32im
riscv32-unknown-elf-gcc -o test test.c
两个命令都给出错误
test.c:2:10: fatal error: rt/rt_api.h: No such file or directory
#include <rt/rt_api.h>
^~~~~~~~~~~~~
compilation terminated.
使用API​​编译C代码的确切命令是什么,我正在使用Pulppissimo工具链。
我的程序是
https://github.com/pulp-platform/pulp-rt-examples/tree/master/periph/uart/loopback

最佳答案

您有此错误,因为riscv gcc搜索路径中不存在rt/rt_api.h。
要查看搜索路径中存在的文件夹,可以将-v选项添加到命令中或使用:

riscv32-unknown-elf-cpp -v /dev/null /dev/null
您可以做的是找到rt/rt_api.h的位置,并将找到的路径提供给gcc。您的命令将是:
riscv32-unknown-elf-gcc -o test test.c -Ipath

关于api - RISCV C至UART的十六进制编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63751301/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com