xiuos3/Ubiquitous/RT_Thread/bsp/k210
chunyexixiaoyu 4c0b05b752 Ubiquitous/RT_Thread/:rt-thread version update to fix the bug that tensflow lite for mcu can't be compiled. 2021-10-22 14:22:47 +08:00
..
applications Ubiquitous/RT_Thread/: add lcd test example update main.c function when it starts. 2021-10-14 11:21:06 +08:00
base-drivers Ubiquitous/RT_Thread/:update K210 bsp base on https://github.com/kendryte/K210-Micropython-OpenMV 2021-10-14 11:19:40 +08:00
kendryte-sdk Ubiquitous/RT_Thread/:update submodule version 2021-10-14 10:47:41 +08:00
.config Ubiquitous/RT_Thread/:rt-thread version update to fix the bug that tensflow lite for mcu can't be compiled. 2021-10-22 14:22:47 +08:00
.gitignore feat(face_detect): read all parameters from SD card json file 2021-08-04 09:48:36 +08:00
Kconfig APP_Framework/:fix some Kconfig file in Applications and Framework. and change know to knowing ,remove uncomfortable file(their location is wrong) 2021-07-14 15:15:57 +08:00
README.md Ubiquitous/RT_Thread/:add K210 bsp 2021-06-16 20:52:57 +08:00
SConscript Ubiquitous/RT_Thread/:add K210 bsp 2021-06-16 20:52:57 +08:00
SConstruct APP_Framework/lib/:add cJSON library 2021-08-04 16:26:37 +08:00
link.lds Ubiquitous/RT_Thread/:add K210 bsp 2021-06-16 20:52:57 +08:00
link_stacksize.lds Ubiquitous/RT_Thread/:add K210 bsp 2021-06-16 20:52:57 +08:00
rtconfig.h Ubiquitous/RT_Thread/:rt-thread version update to fix the bug that tensflow lite for mcu can't be compiled. 2021-10-22 14:22:47 +08:00
rtconfig.py Ubiquitous/RT_Thread/:add K210 bsp 2021-06-16 20:52:57 +08:00

README.md

K210最小系统板Max bit说明

OV2640 menuconfig 配置:

More Driver-------->ov2640 driver (勾选) 保存即可

RW007 menuconfig 配置:

More Driver-------->rw007:SPI WIFI rw007 driver

example driver port (not use example driver, porting by myself)

(20000000) SPI MAX Hz

Board Drivers Config

Enable SPI1

(27) spi1 clk pin number

(28) spi1 d0 pin number

(26) spi1 d1 pin number

SPI1 Enable SS1spi11 dev-------->(8) spi1 ss1 pin number

(spi11) the SPIDEV rw007 driver on

(7) rw007 int pin for rw007

(6) rw007 rst pin for rw007

SPI1 Enable SS1spi11 dev表示SPI1总线片选编号1 此时挂载在总线上设备名是spi11所以 the SPIDEV rw007 driver on参数也要填写spi11

SD卡配置

Board Drivers Config-------->Enable SDCARD (spi1(ss0)) (勾选)保存即可 SPI1 Enable SS0spi10 dev-------->(29) spi1 ss1 pin number 会默认配置

SD卡和RW007共用一条spi硬件总线 其中片选设备sd卡为SPI1 Enable SS0spi10 devRW007片选设备为SPI1 Enable SS1spi11 dev

上述引脚根据电路实际而定,另外涉及到相关的Lwip wifi framwork等已经默认配置并匹配

以下为引脚硬件的连接表

RW007(SPI1 ) Kendryte Sipeed MAX bit io

引脚 作用 引脚序号 RW007板子
io 27(印丝标注SCK) SPI1_SCK SCK
io 26(印丝标注SO) SPI1_MISO MISO
io 28(印丝标注SI) SPI1_MOSI MOSI
io 8 CS/BOOT1 CS
io 7 INT/BUSY D9
io 6 RESET D8

SD卡Kendryte Sipeed MAX bit io

引脚 作用 引脚序号 RW007板子
io 27(印丝标注SCK) SPI1_SCK SCK
io 26(印丝标注SO) SPI1_MISO MISO
io 28(印丝标注SI) SPI1_MOSI MOSI
io 29 CS/BOOT1 CS

注意BSP_SPI1_D0_PIN 10 d0也就是MOSI sd卡可直接利用Max bit板载无需重新接线。SD卡和Rw007设备共用一条SPI1总线

编译说明

编译K210需要有RT-Thread的代码因为K210的sdk是以软件包方式所以需要在bsp/k210下做软件包更新。Windows下推进使用[env工具][1]然后在console下进入bsp/k210目录中运行

cd bsp/k210
pkgs --update

如果在Linux平台下可以先执行

scons --menuconfig

它会自动下载env相关脚本到~/.env目录然后执行

source ~/.env/env.sh

cd bsp/k210
pkgs --update

下载risc-v的工具链下载地址

更新完软件包后,在rtconfig.py中将risc-v工具链的本地路径加入文档。 注:

  1. 工具链建议使用上方提供的,kendryte的官方工具链会报浮点类型不兼容的错误,risc-v工具链8.2.0之前的版本会出现头文件不兼容的问题。
  2. 网上传需要开启C++ 17,认为k210的神经网络编译器nncase多数语法由C++ 17,故需要开启C++ 17。个人认为没有必要nncase是在PC端独立使用的 作用是将神经网络模型转为kmodel格式此格式文件为已经编译的二进制文件.

然后执行scons编译

set RTT_EXEC_PATH=your_toolchains
scons

来编译这个板级支持包。如果编译正确无误会产生rtthread.elf、rtthread.bin文件。其中rtthread.bin需要烧写到设备中进行运行。
如果初次使用编译报错可能是使用的SDK过老使用menuconfig命令,在→ RT-Thread online packages → peripheral libraries and drivers → the kendryte-sdk package for rt-thread中将SDK改为latest版本即可。