Skip to content

Commit 3ade2d0

Browse files
committed
k230 sdk release v1.2
1 parent 98e0c1d commit 3ade2d0

File tree

360 files changed

+38287
-721
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

360 files changed

+38287
-721
lines changed

Kconfig.board

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ config GEN_IMG_SCRIPT
7171
generate image scripte;
7272
default "board/common/gen_image_script/gen_image.sh"
7373
config RTT_CONSOLE_ID
74+
depends on SUPPORT_RTSMART
7475
int "RTT console id"
7576
default 3
7677

Makefile

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ prepare_sourcecode:prepare_toolchain
112112
#ai
113113
@echo "download nncase sdk"
114114
@rm -rf src/big/utils/; rm -rf src/big/ai;
115-
@wget -q --show-progress $(DOWNLOAD_URL)/downloads/kmodel/kmodel_v2.4.0.tgz -O - | tar -xzC src/big/
116-
@wget -q --show-progress $(DOWNLOAD_URL)/downloads/nncase/nncase_k230_v2.4.0.tgz -O - | tar -xzC src/big/
115+
@wget -q --show-progress $(DOWNLOAD_URL)/downloads/kmodel/kmodel_v2.5.1.tgz -O - | tar -xzC src/big/
116+
@wget -q --show-progress $(DOWNLOAD_URL)/downloads/nncase/nncase_k230_v2.5.1.tgz -O - | tar -xzC src/big/
117117

118118
#big utils
119119
@echo "download big utils"
@@ -138,6 +138,15 @@ prepare_sourcecode:prepare_toolchain
138138
@wget -q --show-progress $(DOWNLOAD_URL)/downloads/dl/dl.tar.gz -O - | tar -xzC src/little/buildroot-ext/
139139

140140
@touch src/.src_fetched
141+
142+
#dictionary_pen
143+
@if [ "k230_evb_usiplpddr4_dictionary_pen_defconfig" == "$${CONF}" ] ; then \
144+
echo "download dictionary_pen" ; \
145+
wget -q --show-progress $(DOWNLOAD_URL)/downloads/dictionary_pen/cidianbi_kmodel_v2.5.1.tar.gz -O - | tar -xzC src/reference/business_poc/dictionary_pen_poc/ ; \
146+
cp src/reference/business_poc/dictionary_pen_poc/cidianbi_kmodel_v2.5.1/include src/reference/business_poc/dictionary_pen_poc/ -rf ; \
147+
fi;
148+
149+
141150
check_toolchain:
142151
@if [ ! -f $(CONFIG_TOOLCHAIN_PATH_LINUX)/$(CONFIG_TOOLCHAIN_PREFIX_LINUX)gcc ] || \
143152
[ ! -f $(CONFIG_TOOLCHAIN_PATH_RTT)/$(CONFIG_TOOLCHAIN_PREFIX_RTT)gcc ]; then \
@@ -255,6 +264,15 @@ peephole:check_src
255264
make && make install; rm ./* -rf; \
256265
cd -;
257266

267+
.PHONY: dictionary_pen
268+
dictionary_pen:check_src
269+
@export PATH=$(RTT_EXEC_PATH):$(PATH); \
270+
export RTSMART_SRC_DIR=$(K230_SDK_ROOT)/$(RT-SMART_SRC_PATH); \
271+
cd $(K230_SDK_ROOT)/src/reference/business_poc/dictionary_pen_poc; \
272+
mkdir -p build; \
273+
bash build.sh ;
274+
275+
258276
.PHONY: cdk-kernel
259277
cdk-kernel: linux
260278
@export PATH=$(RTT_EXEC_PATH):$(LINUX_EXEC_PATH):$(PATH);export RTSMART_SRC_DIR=$(K230_SDK_ROOT)/$(RT-SMART_SRC_PATH);export LINUX_BUILD_DIR=$(LINUX_BUILD_DIR); \

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ make prepare_sourcecode
143143

144144
1. 根据不同开发板或软件功能,选择不同的配置config进行编译,编译命令格式:`make CONF=xxx`,如:
145145
> - 编译K230-USIP-LP3-EVB板子镜像,执行`make CONF=k230_evb_defconfig` 命令开始编译
146-
> - 编译CanMV-K230板子的镜像,执行 `make CONF=CONF=k230_canmv_defconfig` 命令开始编译
146+
> - 编译CanMV-K230板子的镜像,执行 `make CONF=k230_canmv_defconfig` 命令开始编译
147147
148148
> - 外部目录中自动下载的toolchain会映射至docker镜像中的`/opt/toolchain/`目录下。
149149
> - 默认参数`-u root`指定docker以root用户执行,k230_sdk无需root权限即可编译
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
android_msg_level=1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
android_msg_level=1
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
image app.vfat {
2+
vfat {
3+
files = {
4+
"big-core/app",
5+
}
6+
}
7+
# empty =true
8+
size = 1024M
9+
}
10+
11+
image sysimage-sdcard.img {
12+
hdimage {
13+
gpt = "true"
14+
}
15+
16+
partition uboot_spl_1 {
17+
#512k@1M 0x400@0x800
18+
in-partition-table = false
19+
offset = 1M
20+
image = "little-core/uboot/fn_u-boot-spl.bin"
21+
}
22+
partition uboot_spl_2 {
23+
#[email protected] 0x800@0xc00
24+
in-partition-table = false
25+
offset = 0x180000
26+
image = "little-core/uboot/fn_u-boot-spl.bin"
27+
}
28+
partition uboot_env {
29+
in-partition-table = false
30+
offset = 0x1e0000
31+
image = "little-core/uboot/env.env"
32+
size = 0x20000
33+
}
34+
partition uboot {
35+
#1.5m@2M 0xc00@0x1000
36+
in-partition-table = false
37+
offset = 2M
38+
image = "little-core/uboot/fn_ug_u-boot.bin"
39+
}
40+
# partition env {
41+
# #[email protected] 0x800@0x1c00
42+
# in-partition-table = false
43+
# offset = 0x380000
44+
# #image = "../little/uboot/u-boot.img"
45+
# }
46+
47+
partition rtt {
48+
#20M@10M 0x800@0x800
49+
offset = 10M
50+
image = "big-core/rtt_system.bin"
51+
size = 20M
52+
}
53+
54+
partition linux {
55+
#50M@30M 0x800@0x800
56+
offset = 30M
57+
image = "little-core/linux_system.bin"
58+
size = 50M
59+
}
60+
61+
partition rootfs {
62+
offset = 128M
63+
partition-type = 0x83
64+
image = "little-core/rootfs.ext4"
65+
}
66+
67+
partition fat32appfs {
68+
#offset = 168M
69+
partition-type = 0xc
70+
# size = 32M
71+
image = "app.vfat"
72+
}
73+
}

board/common/gen_image_script/gen_image_comm_func.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,29 @@
22
source ${K230_SDK_ROOT}/.config
33
source ${K230_SDK_ROOT}/.last_conf
44

5+
gz_file_add_ver()
6+
{
7+
[ $# -lt 1 ] && return
8+
local f="$1"
9+
10+
local sdk_ver="v0.0.0";
11+
local nncase_ver="0.0.0";
12+
13+
local sdk_ver_file="${K230_SDK_ROOT}/board/common/post_copy_rootfs/etc/version/release_version"
14+
local nncase_ver_file="${K230_SDK_ROOT}/src/big/nncase/riscv64/nncase/include/nncase/version.h"
15+
16+
17+
18+
19+
cat ${sdk_ver_file} | grep v | cut -d- -f 1 > /dev/null && \
20+
sdk_ver=$(cat ${sdk_ver_file} | grep v | cut -d- -f 1)
21+
22+
cat ${nncase_ver_file} | grep NNCASE_VERSION -w | cut -d\" -f 2 > /dev/null && \
23+
nncase_ver=$(cat ${nncase_ver_file} | grep NNCASE_VERSION -w | cut -d\" -f 2)
24+
25+
cp $f ${CONFIG_BOARD_NAME}_$(echo "$f" | sed -nE "s#[^-]*-([^\.]*).*#\1#p")_${sdk_ver}_nncase_v${nncase_ver}.img.gz;
26+
}
27+
528

629
#依赖 BUILD_DIR,K230_SDK_ROOT
730
copye_file_to_images()
@@ -271,6 +294,7 @@ gen_image()
271294
rm -rf "${GENIMAGE_TMP}"
272295
gzip -k -f ${image_name}
273296
chmod a+rw ${image_name} ${image_name}.gz;
297+
gz_file_add_ver ${image_name}.gz
274298
}
275299

276300
gen_image_spinor_proc_ai_mode()
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
#!/bin/bash
2+
3+
source ${K230_SDK_ROOT}/board/common/gen_image_script/gen_image_comm_func.sh
4+
5+
6+
env_dir="${K230_SDK_ROOT}/board/common/env"
7+
8+
GENIMAGE_CFG_DIR="${K230_SDK_ROOT}/board/common/gen_image_cfg"
9+
GENIMAGE_CFG_SD="${GENIMAGE_CFG_DIR}/genimage-sdcard-dictionary-pen.cfg"
10+
GENIMAGE_CFG_SPI_NOR="${GENIMAGE_CFG_DIR}/genimage-spinor.cfg"
11+
GENIMAGE_CFG_SPI_NAND="${GENIMAGE_CFG_DIR}/genimage-spinand.cfg"
12+
GENIMAGE_CFG_SD_REMOTE="${GENIMAGE_CFG_DIR}/genimage-sdcard_remote.cfg"
13+
14+
cfg_data_file_path="${GENIMAGE_CFG_DIR}/data"
15+
quick_boot_cfg_data_file="${GENIMAGE_CFG_DIR}/data/quick_boot.bin"
16+
face_database_data_file="${GENIMAGE_CFG_DIR}/data/face_data.bin"
17+
sensor_cfg_data_file="${GENIMAGE_CFG_DIR}/data/sensor_cfg.bin"
18+
ai_mode_data_file="${BUILD_DIR}/images/big-core/ai_mode.bin" #"${GENIMAGE_CFG_DIR}/data/ai_mode.bin"
19+
speckle_data_file="${GENIMAGE_CFG_DIR}/data/speckle.bin"
20+
rtapp_data_file="${BUILD_DIR}/images/big-core/fastboot_app.elf"
21+
22+
23+
24+
25+
gen_dictionary_pen_device_app()
26+
{
27+
#crop little-core
28+
# rm -rf lib/modules/;
29+
# rm -rf lib/libstdc++*;
30+
#rm -rf lib/modules/
31+
#rm -rf usr/bin/fio;
32+
#rm -rf usr/bin/lvgl_demo_widgets;
33+
#rm -rf usr/bin/ssh*
34+
#find mnt/ -type f -not -name k_ipcm.ko -not -name sharefs | xargs rm -rf ;
35+
# rm -rf app/;
36+
rm -rf lib/tuning-server;
37+
#rm -rf usr/bin/stress-ng bin/bash usr/sbin/sshd usr/bin/trace-cmd usr/bin/lvgl_demo_widgets;
38+
#find . -name *.ko | xargs rm -rf ;
39+
40+
# fakeroot -- ${K230_SDK_ROOT}/tools/mkcpio-rootfs.sh;
41+
42+
#cp ${K230_SDK_ROOT}/src/reference/dictionary_pen_poc/cidianbi_kmodel_v2.5.1/include ${K230_SDK_ROOT}/src/reference/dictionary_pen_poc/
43+
#rtapp and ai mode
44+
cd ${K230_SDK_ROOT}; make dictionary_pen;
45+
#creat dictionary_pen dir
46+
mkdir -p ${BUILD_DIR}/images/big-core/app/dictionary_pen/
47+
cp ${K230_SDK_ROOT}/src/reference/business_poc/dictionary_pen_poc/cidianbi_kmodel_v2.5.1/* ${BUILD_DIR}/images/big-core/app/dictionary_pen/ -rf
48+
cp ${K230_SDK_ROOT}/src/reference/business_poc/dictionary_pen_poc/include ${BUILD_DIR}/images/big-core/app/dictionary_pen/ -rf
49+
cp ${K230_SDK_ROOT}/src/reference/business_poc/dictionary_pen_poc/build/dictionary_pen.elf ${BUILD_DIR}/images/big-core/app/dictionary_pen/ -rf
50+
51+
# crop big-core
52+
# find . -type f -not -name fastboot_app.elf -not -name init.sh -not -name doorbell.g711u -not -name person_detect_yolov5n.kmodel -not -name imx335-1920x1080_auto.json* -not -name imx335-1920x1080.bin -not -name imx335-1920x1080_manual.json* -not -name imx335-1920x1080.xml* -not -name imx335-2592x1944_auto.json* -not -name imx335-2592x1944.bin -not -name imx335-2592x1944_manual.json* -not -name imx335-2592x1944.xml* | xargs rm -rf
53+
54+
# rm ${BUILD_DIR}/images/big-core/app/* -rf;
55+
56+
cd ${RTSMART_SRC_DIR}/userapps/; python3 ../tools/mkromfs.py ${BUILD_DIR}/images/big-core/root/ ${RTSMART_SRC_DIR}/kernel/bsp/maix3/applications/romfs.c;
57+
cd ${K230_SDK_ROOT};make rtt_update_romfs;
58+
59+
cp ${BUILD_DIR}/big/rt-smart/rtthread.* ${BUILD_DIR}/images/big-core/;
60+
}
61+
62+
copye_file_to_images;
63+
gen_dictionary_pen_device_app;
64+
gen_version;
65+
gen_uboot_bin;
66+
gen_linux_bin;
67+
gen_final_ext2;
68+
gen_rtt_bin;
69+
gen_env_bin;
70+
copy_app;
71+
72+
if [ "${CONFIG_REMOTE_TEST_PLATFORM}" = "y" ] ; then
73+
gen_image ${GENIMAGE_CFG_SD_REMOTE} sysimage-sdcard.img
74+
else
75+
gen_image ${GENIMAGE_CFG_SD} sysimage-sdcard.img
76+
fi
77+
78+
if [ "${CONFIG_GEN_SECURITY_IMG}" = "y" ] ; then
79+
gen_image ${GENIMAGE_CFG_SD_AES} sysimage-sdcard_aes.img
80+
gen_image ${GENIMAGE_CFG_SD_SM} sysimage-sdcard_sm.img
81+
fi
82+
83+
# gen_image_spinor
84+
# gen_image_spinand;
85+
86+
87+
88+
cd ${BUILD_DIR}/images/
89+
rm -rf sysimage-sdcard_aes.img sysimage-sdcard_sm.img *.vfat
90+
91+
92+
93+
94+
95+
96+
97+
98+

board/k230_evb_doorlock/gen_image_script/gen_doorlock_image.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ shrink_rootfs()
4848
rm -rf usr/bin/k230_timer_demo
4949
rm -rf usr/bin/gpio_keys_demo
5050
rm -rf lib/modules/5.10.4+/kernel/drivers/gpu/
51-
rm -rf /lib/modules/5.10.4+/kernel/drivers/net/wireless/aich/aiw4211lv10/aiw4211lv10.ko
51+
5252
find mnt/ -type f -not -name k_ipcm.ko -not -name sharefs | xargs rm -rf ;
5353
# rm -rf app/;
5454
rm -rf lib/tuning-server;
@@ -82,16 +82,16 @@ gen_env_bin;
8282
copy_app;
8383

8484

85-
if [ "${CONFIG_REMOTE_TEST_PLATFORM}" = "y" ] ; then
86-
gen_image ${GENIMAGE_CFG_SD_REMOTE} sysimage-sdcard.img
87-
else
88-
gen_image ${GENIMAGE_CFG_SD} sysimage-sdcard.img
89-
fi
85+
# if [ "${CONFIG_REMOTE_TEST_PLATFORM}" = "y" ] ; then
86+
# gen_image ${GENIMAGE_CFG_SD_REMOTE} sysimage-sdcard.img
87+
# else
88+
# gen_image ${GENIMAGE_CFG_SD} sysimage-sdcard.img
89+
# fi
9090

91-
if [ "${CONFIG_GEN_SECURITY_IMG}" = "y" ] ; then
92-
gen_image ${GENIMAGE_CFG_SD_AES} sysimage-sdcard_aes.img
93-
gen_image ${GENIMAGE_CFG_SD_SM} sysimage-sdcard_sm.img
94-
fi
91+
# if [ "${CONFIG_GEN_SECURITY_IMG}" = "y" ] ; then
92+
# gen_image ${GENIMAGE_CFG_SD_AES} sysimage-sdcard_aes.img
93+
# gen_image ${GENIMAGE_CFG_SD_SM} sysimage-sdcard_sm.img
94+
# fi
9595

9696
if [ "${CONFIG_SPI_NOR}" = "y" ]; then
9797
cd ${BUILD_DIR}/;rm -rf images_bak;cp images images_bak -r;

board/k230_evb_doorlock/gen_image_script/gen_doorlock_ov9286_image.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,16 @@ gen_env_bin;
8888
copy_app;
8989

9090

91-
if [ "${CONFIG_REMOTE_TEST_PLATFORM}" = "y" ] ; then
92-
gen_image ${GENIMAGE_CFG_SD_REMOTE} sysimage-sdcard.img
93-
else
94-
gen_image ${GENIMAGE_CFG_SD} sysimage-sdcard.img
95-
fi
96-
97-
if [ "${CONFIG_GEN_SECURITY_IMG}" = "y" ] ; then
98-
gen_image ${GENIMAGE_CFG_SD_AES} sysimage-sdcard_aes.img
99-
gen_image ${GENIMAGE_CFG_SD_SM} sysimage-sdcard_sm.img
100-
fi
91+
# if [ "${CONFIG_REMOTE_TEST_PLATFORM}" = "y" ] ; then
92+
# gen_image ${GENIMAGE_CFG_SD_REMOTE} sysimage-sdcard.img
93+
# else
94+
# gen_image ${GENIMAGE_CFG_SD} sysimage-sdcard.img
95+
# fi
96+
97+
# if [ "${CONFIG_GEN_SECURITY_IMG}" = "y" ] ; then
98+
# gen_image ${GENIMAGE_CFG_SD_AES} sysimage-sdcard_aes.img
99+
# gen_image ${GENIMAGE_CFG_SD_SM} sysimage-sdcard_sm.img
100+
# fi
101101

102102
if [ "${CONFIG_SPI_NOR}" = "y" ] ;then
103103
cd ${BUILD_DIR}/;rm -rf images_bak;cp images images_bak -r;

0 commit comments

Comments
 (0)