您的位置:首页 > 其它

nuttx移植

2018-02-07 14:45 363 查看
1、在ubuntu根目录下:root@ubuntu:/#apt-get update              
#更新包

2、root@ubuntu:/#apt-get install gcc-arm-none-eabi               #编译器

3、kconfig-frontends下载:http://ymorin.is-a-geek.org/download/kconfig-frontends/

     将下载下来的包解压到:mnt/nx/misc,再将文件后边的版本号去掉,即将文件夹重命名为:                kconfig-frontends 

4、root@ubuntu:/#apt-get install gperf libncurses5-dev flex bison              
#下载依赖项

5、root@ubuntu:/#cd  mnt/nx/misc/kconfig-frontends/ 

6、root@ubuntu:/#   ./configure

7、root@ubuntu:/#   make

8、root@ubuntu:/# make install

9、下载Nuttx源码:http://sourceforge.net/projects/nuttx/files/nuttx/下载两个压缩包:nuttx-7.15.tar.gz 
和apps-7.15.tar.gz

10、将两个压缩包解压到/mnt/nx下,去掉版本号,即文件夹重新命名为:nuttx 和 apps

11、root@ubuntu:/#cd /mnt/nx/nuttx/tools

12、root@ubuntu:/#./configure.sh stm32_tiny/nsh

13、root@ubuntu:/#cd /mnt/nx/nuttx/

14、root@ubuntu:/# make menuconfig               #可以看到以图形p配置界面

15、选择Build Setup,进入后选择Build Host platform,将其改成LINUX

16、选择System Type,进入后选择ARM chip selection (STMicro STM32 F1/F2/F3/F4) ,    STM32 Chip Selection (STM32F103VE)芯片选型,以及Toolchain Selection(Generic GNU EABI toochain under linux(or other POSIX environment)

17、选择Board Selection,进入后选择目标板Select target board (M3 Wildfire STM32 board)

18、选择Application Configuration-->example-->hello 应用程序(打印hello world)

19、保存后退出,root@ubuntu:/# cp  /usr/local/lib/libkconfig-parser-3.12.0.so
  lib 

20、root@ubuntu:/# ./setenv.sh

21、root@ubuntu:/# make                       #生成.bin和.hex文件

22、安装openocd,sudo apt-get install openocd

23、 openocd -f interface/stlink-v2.cfg -f target/stm32f1x_stlink.cfg -c init -c "reset halt" -c "flash write_image erase nuttx.bin 0x08000000" -c "reset run" -c exit   //  download

24、安装minicom,sudo apt-get install minicom;

25. minicom 的配置,sudo minicom -s, 主要配置USB,以及波特率,配置好后save,然后exit, 进入ssh.

26、输入hello,运行应用程序,可以看到打印出hello world!的程序,大功告成
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: