CanMV K230

The Kendryte K230 SoC contains two indepedent T-Head C908 based RV64GC CPU cores. The CPU1 even has RVV1.0 vector extension and operates at higher speed. The SoC contains accelerators for depth image processing, audio processing and neural network inferencing etc.

The CanMV K230 is a raspberry-pi sized single board computer with 512MB DRAM and a microSD card slot for booting. It comes with serial console, Ethernet, HDMI and USB/OTG ports. Unfortuunately it doesn’t support JTAG alike debugging interfaces.

The K230 SDK contains source code, libraries and user guides for booting up an AMP enviroment with Linux on CPU0 and RT-Thread on CPU1.

K230 boots from CPU0 and loads U-Boot into DRAM first, then U-Boot kicks off OpenSBI wrapped Linux/RTT OS images on respective CPU cores accordingly.

The K230 U-Boot operates in machine mode, thus provides an ideal environment for NuttX. allowing one to run flat or kernel builds in theory.

Preparations

Please follow the K230 SDK to prepare a booting SD card for the board, or use prebuilt boot image from here.

Make sure that before trying NuttX:

  • The board can boot default SDK image normally.

  • U-Boot console can be accessed from host(e.g. minicom -D /dev/ttyACM0).

  • U-Boot has access to a TFTP service is available.

  • You can drop files to the TFTP service folder.

Note for below NuttX tests, the SD image is only used to enter U-Boot console.

RISC-V Toolchain

Before building NuttX for Star64, download the RISC-V Toolchain riscv64-unknown-elf from XPack or use “gcc-riscv64-unknown-elf” on Ubuntu.

Building

To build NuttX for CanMV, install the prerequisites and clone the git repositories for nuttx and apps.

Configure the NuttX project and build the project:

$ cd nuttx
$ tools/configure.sh canmv230:nsh
$ make -j4

There should have nuttx.bin generated.

Booting

Copy the nuttx.bin to the TFTP service folder and work with the U-Boot console:

k230# usb start
k230# ping $serverip
k230# tftp 8000000 nuttx.bin
k230# boot_barememtal 0 8000000 $filesize

Then the nsh> `console should appear, type `help to see available commands.