K230 CanMV
K230 RISC-V SoC
The K230 chip is the latest generation SoC product in Canaan Technology’s Kendryte series of AIOT chips.
Mainline support
The support for following drivers are already enabled:
ns16550 UART
DWC2 OTG USB controller
Building
Get the RISC-V toolchain.
Setup cross compilation environment variable:
Get the firmware_gen.py from vendor.
export CROSS_COMPILE=riscv64-linux-gnu- cd <U-Boot-dir> make k230_canmv_defconfig make cp u-boot-gz.img u-boot-gz.img.tmp pip install gmssl pycryptodome python3 firmware_gen.py -i u-boot-gz.img.tmp -o u-boot-head.img -n
This will generate u-boot-head.img.
Booting
Currently, we rely on vendor u-boot-spl to initialize the ddr and load the u-boot image, then bootup from it.
Prepare a SD card with the vendor image burned on it.
Write the U-Boot image to the SD card at offset 2MB.
dd if=u-boot-head.img of=/dev/sd[x] bs=1M seek=2
Insert the SD card into the board and power it on.
Sample boot log from K230 CanMV board
U-Boot 2025.01-00645-g2d81c4788455 (Jan 14 2025 - 23:15:07 +0800) DRAM: 512 MiB Core: 15 devices, 11 uclasses, devicetree: separate Loading Environment from nowhere... OK In: serial@91400000 Out: serial@91400000 Err: serial@91400000 Net: No ethernet found. K230# cpu list 0: cpu@0 thead,c908 K230# usb start starting USB... Bus usb@91540000: USB DWC2 scanning bus usb@91540000 for devices... Warning: r8152_eth (eth0) using random MAC address - 1e:33:97:47:e6:32 2 USB Device(s) found K230# usb tree USB device tree: 1 Hub (480 Mb/s, 0mA) | U-Boot Root Hub | +-2 Vendor specific (480 Mb/s, 100mA) Realtek USB 10/100 LAN 000000000000 K230#