Nuttx实时操作系统 SAMV71-Xplained开发板适配

官网参考:
https://nuttx.apache.org/docs/latest/quickstart/compiling.html

1、board配置

nhf@nhf-VirtualBox:~/work/learn/nuttx/NUTTX/nuttx$ ./tools/configure.sh -L | grep samv71
  samv71-xult:nsh
  samv71-xult:netnsh
  samv71-xult:vnc
  samv71-xult:module
  samv71-xult:nxwm
  samv71-xult:vnxwm
  samv71-xult:knsh
  samv71-xult:mxtxplnd
  samv71-xult:mrf24j40-starhub
nhf@nhf-VirtualBox:~/work/learn/nuttx/NUTTX/nuttx$ ./tools/configure.sh -l samv71-xult:nsh
  ......
  mkkconfig in /home/nhf/mnt/newdisk/work/learn/nuttx/NUTTX/apps
  make[1]: 离开目录“/home/nhf/mnt/newdisk/work/learn/nuttx/NUTTX/apps”
  #
  # configuration written to .config
  #

2、外设配置

在这里插入图片描述
打开menuconfig

nhf@nhf-VirtualBox:~/work/learn/nuttx/NUTTX/nuttx$ make menuconfig

在这里插入图片描述

图中usb连接是串口usart1,所以使能usart1,作为调试口:
使能usart1外设
  System Type —>SAMV7 Peripheral Selection -->USART 1
选择usart1外设作为console调试口:
  Device Drivers —>Serial Driver Support -->Serial console
使能SD卡接口支持:
  System Type -->SAMV7 Peripheral Selection -->High Speed Multimedia Card Interface (HSMCI)
使能文件系统自动挂载:
  File System -->Auto-mounter
使能SD卡自动挂载:
   Board Selection–>HSMCI0 automounter
使能根文件系统支持:
  File Systems -->ROMFS system
使能根文件系统启动脚本支持:
  Application Configuration -->NSH Library -->Scripting Support -->Support ROMFS start-up script
使能内置命令例程:
  Application Configuration -->Examples
使能命令行历史:
  Application Configuration -->System Libraries and NSH Add-Ones -->read() Support

基本配置完成。

3、编译

nhf@nhf-VirtualBox:~/work/learn/nuttx/NUTTX/nuttx$ make -j8
make[1]: 进入目录“/home/nhf/mnt/newdisk/work/learn/nuttx/NUTTX/nuttx”
make[1]: 进入目录“/home/nhf/mnt/newdisk/work/learn/nuttx/NUTTX/nuttx/tools”
make[1]: 进入目录“/home/nhf/mnt/newdisk/work/learn/nuttx/NUTTX/nuttx/tools”
make[1]: 进入目录“/home/nhf/mnt/newdisk/work/learn/nuttx/NUTTX/nuttx/tools”
make[1]: 进入目录“/home/nhf/mnt/newdisk/work/learn/nuttx/NUTTX/nuttx/tools”
make[1]: 离开目录“/home/nhf/mnt/newdisk/work/learn/nuttx/NUTTX/nuttx/tools”
make[2]: 进入目录“/home/nhf/mnt/newdisk/work/learn/nuttx/NUTTX/nuttx/boards”
make[1]: 离开目录“/home/nhf/mnt/newdisk/work/learn/nuttx/NUTTX/nuttx/tools”
......
CC:  sam_boot.c
CC:  sam_sdram.c
CC:  sam_appinit.c
CC:  sam_bringup.c
CC:  sam_autoleds.c
CC:  sam_buttons.c
CC:  sam_automount.c
CC:  sam_hsmci.c
CC:  sam_at24config.c
AR (create): libboard.a   sam_boot.o sam_sdram.o sam_appinit.o sam_bringup.o sam_autoleds.o sam_buttons.o sam_hsmci.o sam_automount.o sam_at24config.o 
make[2]: 离开目录“/home/nhf/mnt/newdisk/work/learn/nuttx/NUTTX/nuttx/boards/arm/samv7/samv71-xult/src”
LD: nuttx
make[1]: 离开目录“/home/nhf/mnt/newdisk/work/learn/nuttx/NUTTX/nuttx/arch/arm/src”
CP: nuttx.bin

编译成功之后,生成 nuttx.bin,即可烧录至开发板中进行调试。

4、console

程序烧录完之后,打开串口终端工具,有如下打印信息,即编译并烧录成功:

NuttShell (NSH) NuttX-10.1.0
nsh> 
nsh> 
nsh> 
nsh> ls
/:
 dev/
 etc/
 proc/
nsh> ls
/:
 dev/
 etc/
 mnt/
 proc/
nsh> cd mnt
nsh> ls
/mnt:
 sdcard0/
nsh> cd sdcard0
nsh> ls
/mnt/sdcard0:
 System Volume Information/
 wert
 readme.txt
 s.txt
nsh>

4、可直接下载代码使用

https://download.csdn.net/download/niu_88/34472307

猜你喜欢

转载自blog.csdn.net/niu_88/article/details/120755227