- Source Code Link: https://github.com/apache/nuttx
- Reference Installation Document: https://nuttx.apache.org/docs/latest/platforms/risc-v/k230/boards/canmv230/index.html
- Toolchain:
- Development Board: Canaan Kendryte K230
- USB A to C / USB C to C cables
- SD card
- Network connection and TFTP server
Get the pre-built boot image:
wget https://gitee.com/yf1972/filexfers/releases/download/canmv230-tools-for-nuttx-v1.2/canmv230-opensbi-dtb.tar.xz
wget https://gitee.com/yf1972/filexfers/releases/download/canmv230-tools-for-nuttx-v1.2/canmv230-sdcard.img.xz
Get the toolchain:
wget https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v13.2.0-2/xpack-riscv-none-elf-gcc-13.2.0-2-linux-x64.tar.gz
tar -xvzf xpack-riscv-none-elf-gcc-13.2.0-2-linux-x64.tar.gz
export PATH=path/to/toolchain/bin:$PATH
Clone the repository and configure it:
mkdir nuttx && cd nuttx
git clone https://github.com/apache/nuttx.git nuttx
git clone https://github.com/apache/nuttx-apps.git apps
cd nuttx
make distclean
./tools/configure.sh canmv230:nsh
make -j$(nproc)
Flash the SBI environment to the SD card:
unxz -k canmv230-sdcard.img.xz
sudo dd if=canmv230-sdcard.img of=/dev/your/device bs=1M status=progress
Place the built nuttx.bin in the TFTP server, load and run it from the U-boot console (manually interrupt autoboot):
k230# usb start
k230# env edit serverip
env: your.tftp.server.ip
k230# dhcp
k230# ping $serverip
k230# tftp 8000000 nuttx.bin
k230# go 8000000
Connect to the development board via the serial port.
Build successful, the development board outputs boot information normally.
Build successful, the development board outputs boot information normally.
Screen recording (from flashing system to booting):
## Starting application at 0x08000000 ...
ABC
NuttShell (NSH) NuttX-12.5.1
nsh> cat /proc/version
NuttX version 12.5.1 6e941aed8b May 7 2024 10:24:29 canmv230:nsh
nsh>
Successful: The actual result matches the expected result.
Failed: The actual result does not match the expected result.
Test successful.