Nuttx操作系统(一):环境搭建

1.1 搭建nuttx编译环境

1.1.1 安装riscv32交叉编译工具链

Install RISC-V toolchains

$ git clone --recursive https://github.com/riscv/riscv-gnu-toolchain

国内下载地址,每天更新一次

#git clone --recursive git@gitee.com:mirrors/riscv-gnu-toolchain.git

$ cd riscv-gnu-toolchain/

$ mkdir build && cd build

$ ../configure --prefix=/opt/riscv --enable-multilib

$ sudo make

$ export PATH=$PATH:/opt/riscv/bin

1.1.2 安装Qemu

https://www.sifive.com/software

$ ./configure --target-list=riscv32-softmmu

$ make

$ sudo make install

可以输入qemu-system-riscv32 --version验证是否成功

1.1.3 获取nuttx源代码

$ git clone https://github.com/apache/incubator-nuttx.git nuttx

$ git clone https://github.com/apache/incubator-nuttx-apps.git apps

$ git clone https://starcat-http://io@bitbucket.org/nuttx/tools.git tools

1.1.4 安装kconfig-frontends

cd ${CURDIR}/tools/kconfig-frontends

$ ./configure --enable-mconf --disable-nconf --disable-gconf --disable-qconf

$ make

$ sudo make install

1.1.5 编译与运行

make distclean

首先进入nuttx目录,输入./tools/configure.sh -l hifive1-revb:nsh。

输入make menuconfig进入配置选择开发板。

error while loading shared libraries: libkconfig-parser-4.11.0.so: cannot open shared object file: No such file or directory

解决办法

sudo vim /etc/ld.so.conf

在下面添加一行

include /usr/local/lib

qemu-system-riscv32 -nographic -machine sifive_e -kernel ./nuttx -s -S

riscv64-unknown-elf-gdb nuttx

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值