Skip to content

Commit

Permalink
k230 sdk release v1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
wuwentao committed Apr 15, 2024
1 parent 71e1511 commit 862c15c
Show file tree
Hide file tree
Showing 1,911 changed files with 657,797 additions and 18,599 deletions.
45 changes: 33 additions & 12 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,23 @@ default:
interruptible: true

# download dir publish with tag
download_dir_publish:
download_dir_release:
rules:
- if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG =~ /^v\d+\.\d+.*$/
extends:
- .setup_env
- .sync_download_dir
- .release_download_dir

# sdk zip and image publish with tag
release_file_publish:
release_image_publish:
rules:
- if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG =~ /^v\d+\.\d+.*$/
parallel:
matrix:
- CONF: [k230_evb_defconfig, k230_canmv_defconfig]
extends:
- .setup_env
- .sync_release_file
- .sync_release_image

# MR merged
merge_sync:
Expand Down Expand Up @@ -110,6 +113,7 @@ build-image:

.sync_github_gitee:
timeout: 30m
retry: 2
tags:
- k230_sdk
script:
Expand All @@ -136,30 +140,47 @@ build-image:
- echo "---push to github---"
- git push --atomic --tags -u -f github main || git push --atomic --tags -u -f github main || git push --atomic --tags -u -f github main

.sync_download_dir:
.release_download_dir:
timeout: 60m
retry: 2
tags:
- k230_sdk
script:
- cd $CI_PROJECT_DIR
- ls -alht
- wget -qc https://ai.b-bug.org/k230/test_resources/ci/release/sync_file.sh -O ./sync_file.sh
- chmod +x ./sync_file.sh
- time ./sync_file.sh || time ./sync_file.sh
- wget -qc https://ai.b-bug.org/k230/test_resources/ci/release/release_download_dir.sh -O ./release_download_dir.sh
- chmod +x ./release_download_dir.sh
- time ./release_download_dir.sh || time ./release_download_dir.sh
- echo "all file synced"

.sync_release_file:
.sync_release_image:
timeout: 60m
retry: 2
tags:
- k230_sdk
script:
- cd $CI_PROJECT_DIR
- ls -alht
- wget -qc https://ai.b-bug.org/k230/test_resources/ci/release/sync_release.sh -O ./sync_release.sh
- chmod +x ./sync_release.sh
- wget -qc https://ai.b-bug.org/k230/test_resources/ci/release/release_k230_sdk_image.sh -O ./release_k230_sdk_image.sh
- chmod +x ./release_k230_sdk_image.sh
- echo $CI_COMMIT_TAG || exit 1
- echo $CONF || exit 1
- time ./sync_release.sh $CI_COMMIT_TAG $CONF || time ./sync_release.sh $CI_COMMIT_TAG $CONF
- time ./release_k230_sdk_image.sh $CI_COMMIT_TAG $CONF || time ./release_k230_sdk_image.sh $CI_COMMIT_TAG $CONF
- echo "all release file synced"

.sync_github_zip:
timeout: 60m
retry: 2
tags:
- k230_sdk
script:
- cd $CI_PROJECT_DIR
- ls -alht
- wget -qc https://ai.b-bug.org/k230/test_resources/ci/release/release_k230_sdk_github_zip.sh -O ./release_k230_sdk_github_zip.sh
- chmod +x ./release_k230_sdk_github_zip.sh
- echo $CI_COMMIT_TAG || exit 1
- echo $CONF || exit 1
- time ./release_k230_sdk_github_zip.sh $CI_COMMIT_TAG || time ./release_k230_sdk_github_zip.sh $CI_COMMIT_TAG
- echo "all release file synced"

.generate_version: &generate_version
Expand Down
10 changes: 10 additions & 0 deletions Kconfig.board
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,20 @@ config BOARD_K230_CANMV
help
"CANMV(K230PI)";

config BOARD_K230_CANMV_V2
bool "K230 CANMV(K230PI) V2"
help
"CANMV(K230PI) V2";

config BOARD_K230D_CANMV
bool "K230D CANMV(K230PI zero)"
help
"CANMV(K230D PI zero)";

config BOARD_K230_CANMV_01STUDIO
bool "K230 CANMV(01STUDIO)"
help
"CANMV(01STUDIO)";
endchoice

config BOARD_NAME
Expand Down
35 changes: 26 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ else ifeq ($(CONFIG_SUPPORT_RTSMART),y)
all .DEFAULT: check_src prepare_memory mpp rt-smart-apps rt-smart-kernel big-core-opensbi uboot build-image
else ifeq ($(CONFIG_SUPPORT_LINUX),y)
all .DEFAULT: check_src prepare_memory linux little-core-opensbi buildroot uboot build-image
endif
endif

ifeq ($(NATIVE_BUILD),1)
.PHONY: download_toolchain
Expand Down Expand Up @@ -112,8 +112,8 @@ prepare_sourcecode:prepare_toolchain
#ai
@echo "download nncase sdk"
@rm -rf src/big/utils/; rm -rf src/big/ai;
@wget -q --show-progress $(DOWNLOAD_URL)/downloads/kmodel/kmodel_v2.8.0.tgz -O - | tar -xzC src/big/
@wget -q --show-progress $(DOWNLOAD_URL)/downloads/nncase/nncase_k230_v2.8.0.tgz -O - | tar -xzC src/big/
@wget -q --show-progress $(DOWNLOAD_URL)/downloads/kmodel/kmodel_v2.8.1.tgz -O - | tar -xzC src/big/
@wget -q --show-progress $(DOWNLOAD_URL)/downloads/nncase/nncase_k230_v2.8.1.tgz -O - | tar -xzC src/big/

#big utils
@echo "download big utils"
Expand Down Expand Up @@ -142,7 +142,7 @@ prepare_sourcecode:prepare_toolchain
#dictionary_pen
@if [ "k230_evb_usiplpddr4_dictionary_pen_defconfig" == "$${CONF}" ] ; then \
echo "download dictionary_pen" ; \
wget -q --show-progress $(DOWNLOAD_URL)/downloads/dictionary_pen/cidianbi_kmodel_v2.8.0.tar.gz -O - | tar -xzC src/reference/business_poc/dictionary_pen_poc/ ; \
wget -q --show-progress $(DOWNLOAD_URL)/downloads/dictionary_pen/cidianbi_kmodel_v2.8.1.tar.gz -O - | tar -xzC src/reference/business_poc/dictionary_pen_poc/ ; \
cp src/reference/business_poc/dictionary_pen_poc/cidianbi_kmodel/include src/reference/business_poc/dictionary_pen_poc/ -rf ; \
fi;

Expand Down Expand Up @@ -239,6 +239,22 @@ mpp: mpp-kernel mpp-apps
.PHONY: mpp-clean
mpp-clean: mpp-kernel-clean mpp-apps-clean

.PHONY: mpp-middleware
mpp-middleware:
@export PATH=$(RTT_EXEC_PATH):$(PATH); \
export RTSMART_SRC_DIR=$(K230_SDK_ROOT)/$(RT-SMART_SRC_PATH); \
cd $(MPP_SRC_DIR); \
make -C middleware || exit $?; \
cd -;

.PHONY: mpp-middleware-clean
mpp-middleware-clean:
@export PATH=$(RTT_EXEC_PATH):$(PATH); \
export RTSMART_SRC_DIR=$(K230_SDK_ROOT)/$(RT-SMART_SRC_PATH); \
cd $(MPP_SRC_DIR); \
make clean -C middleware; \
cd -;

.PHONY: poc
poc:check_src
@export PATH=$(RTT_EXEC_PATH):$(PATH); \
Expand All @@ -247,15 +263,15 @@ poc:check_src
mkdir -p build; cd build; cmake ../; \
make && make install; rm ./* -rf; \
cd -;

@export PATH=$(RTT_EXEC_PATH):$(PATH); \
export RTSMART_SRC_DIR=$(K230_SDK_ROOT)/$(RT-SMART_SRC_PATH); \
cd $(K230_SDK_ROOT)/src/reference/business_poc/doorlock_ov9286/big; \
mkdir -p build; cd build; cmake ../; \
make && make install; rm ./* -rf; \
cd -;

.PHONY: peephole
.PHONY: peephole
peephole:check_src
@export PATH=$(RTT_EXEC_PATH):$(PATH); \
export RTSMART_SRC_DIR=$(K230_SDK_ROOT)/$(RT-SMART_SRC_PATH); \
Expand All @@ -264,7 +280,7 @@ peephole:check_src
make && make install; rm ./* -rf; \
cd -;

.PHONY: dictionary_pen
.PHONY: dictionary_pen
dictionary_pen:check_src
@export PATH=$(RTT_EXEC_PATH):$(PATH); \
export RTSMART_SRC_DIR=$(K230_SDK_ROOT)/$(RT-SMART_SRC_PATH); \
Expand Down Expand Up @@ -374,6 +390,7 @@ linux-menuconfig:
linux-savedefconfig:
cd $(LINUX_SRC_PATH); \
make O=$(LINUX_BUILD_DIR) CROSS_COMPILE=$(LINUX_EXEC_PATH)/$(LINUX_CC_PREFIX) ARCH=riscv savedefconfig; \
cp $(LINUX_BUILD_DIR)/defconfig arch/riscv/configs/$(LINUX_KERNEL_DEFCONFIG);\
cd -

.PHONY: linux
Expand All @@ -397,7 +414,7 @@ big-core-opensbi: rt-smart-kernel
export PLATFORM=kendryte/fpgac908; \
make FW_FDT_PATH=hw.dtb FW_PAYLOAD_PATH=rtthread.bin O=$(BIG_OPENSBI_BUILD_DIR) OPENSBI_QUIET=1 || exit $?; \
cd -
rtt_update_romfs:
rtt_update_romfs:
@export RTT_CC=$(RTT_CC); \
export RTT_CC_PREFIX=$(RTT_CC_PREFIX); \
export RTT_EXEC_PATH=$(RTT_EXEC_PATH); \
Expand All @@ -414,7 +431,7 @@ rtt_update_romfs:
export PLATFORM=kendryte/fpgac908; \
$(MAKE) FW_FDT_PATH=hw.dtb FW_PAYLOAD_PATH=rtthread.bin O=$(BIG_OPENSBI_BUILD_DIR) OPENSBI_QUIET=1 || exit $?; \
cd -

.PHONY: big-core-opensbi-clean
big-core-opensbi-clean:
rm -rf $(BIG_OPENSBI_BUILD_DIR); \
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,7 @@ k230_evb_defconfig/images
sudo dd if=sysimage-sdcard.img of=/dev/sdx bs=1M oflag=sync
```

如使用Windows烧录, 建议使用[the balena Etcher](https://etcher.balena.io/)工具(**请在Etcher图标上点击右键,以管理员权限运行,进行烧录**).

![Etcher](https://github.com/kendryte/k510_docs/raw/v1.5/zh/images/quick_start/balenaetcher.png)
如使用Windows烧录, 建议使用[rufus](http://rufus.ie/downloads/)工具

其它更详细的烧录方法,请参考K230 SDK文档

Expand Down
1 change: 1 addition & 0 deletions board/common/env/default.env
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ upspiimg=usb start; dhcp; tftp 0x9000000 10.10.1.94:wjx/sysimage-spinor32m.img;
upspiuboot=usb start; dhcp; tftp 0xc100000 10.10.1.94:wjx/u-boot.img && sf probe 0:0;sf erase 0x80000 0x180000; sf update 0x$fileaddr 0x80000 0x$filesize; sf remove;
usb_load=usb start; dhcp; tftp $ramdisk_addr jiangxiangbing/rtt_system.bin; k230_boot mem $ramdisk_addr 0x$filesize; tftp $kernel_addr jiangxiangbing/fw_payload.img;tftp $ramdisk_addr jiangxiangbing/rootfs-final.cpio.gz;tftp $dtb_addr jiangxiangbing/k230.dtb
vendor=canaan
cdloadadd=0x10000000
quick_boot=false
4 changes: 2 additions & 2 deletions board/common/gen_image_script/gen_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ speckle_data_file="${GENIMAGE_CFG_DIR}/data/speckle.bin"
rtapp_data_file="${BUILD_DIR}/images/big-core/fastboot_app.elf"

copye_file_to_images;
if [ "${CONFIG_SUPPORT_LINUX}" = "y" ]; then
gen_version;
gen_version;
if [ "${CONFIG_SUPPORT_LINUX}" = "y" ]; then
add_dev_firmware;
gen_linux_bin;
gen_final_ext2;
Expand Down
9 changes: 8 additions & 1 deletion board/common/gen_image_script/gen_image_comm_func.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,20 @@ gen_version()

local ver_file="etc/version/release_version"
local post_copy_rootfs_dir="${K230_SDK_ROOT}/board/common/post_copy_rootfs"
local nncase_ver="0.0.0";
local nncase_ver_file="${K230_SDK_ROOT}/src/big/nncase/riscv64/nncase/include/nncase/version.h"

cat ${nncase_ver_file} | grep NNCASE_VERSION -w | cut -d\" -f 2 > /dev/null && \
nncase_ver=$(cat ${nncase_ver_file} | grep NNCASE_VERSION -w | cut -d\" -f 2)


cd "${BUILD_DIR}/images/little-core/rootfs" ;
mkdir -p etc/version/


set +e; commitid=$(awk -F- '/^[^#]/ { print $6}' ${post_copy_rootfs_dir}/${ver_file});set -e;
set +e; last_tag=$(awk -F- '/^[^#]/ { print $1}' ${post_copy_rootfs_dir}/${ver_file}) ;set -e;
set +e; last_tag=$(awk -F- '/^[^#]/ { print $1}' ${post_copy_rootfs_dir}/${ver_file} | head -1 ) ;set -e;



[ "${commitid}" != "" ] || commitid="unkonwn"
Expand All @@ -107,6 +113,7 @@ gen_version()
ver="${last_tag}-$(date "+%Y%m%d-%H%M%S")-$(whoami)-$(hostname)-${commitid}"
echo -e "#############SDK VERSION######################################" >${ver_file}
echo -e ${ver} >> ${ver_file}
echo -e "nncase:${nncase_ver}" >> ${ver_file}
echo -e "##############################################################" >>${ver_file}
echo "build version: ${ver}"

Expand Down
52 changes: 52 additions & 0 deletions board/k230_canmv_dpu_depth_camera/dpu_depth_camera_rcS
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/sh


# Start all init scripts in /etc/init.d
# executing them in numerical order.
#
for i in /etc/init.d/S??* ;do

# Ignore dangling symlinks (if any).
[ ! -f "$i" ] && continue

case "$i" in
*.sh)
# Source shell script for speed.
(
trap - INT QUIT TSTP
set start
. $i
)
;;
*)
# No sh extension, so fork subprocess.
$i start
;;
esac
done
bootddev=$(cat /proc/cmdline | sed -n "s#root=\(\/dev\/mmcblk[0-9]\).*#\1#p" )
printf "fix\n" | parted ---pretend-input-tty ${bootddev} print >/dev/null 2>&1

cat /etc/version/release_version
# if ! `grep mmc /proc/cmdline >/dev/null` ; then
# if `grep mtd5 /proc/mtd >/dev/null`; then
# mount -t jffs2 /dev/mtdblock5 /mnt || (flash_erase /dev/mtd5 0 0; mount -t jffs2 /dev/mtdblock5 /mnt)
# fi;
# fi

cd /mnt
insmod k_ipcm.ko
mkdir /sharefs -p
if `grep mmcblk0p3 /proc/cmdline >/dev/null` ; then
mount /dev/mmcblk0p4 /sharefs
elif `grep mmcblk1p3 /proc/cmdline >/dev/null` ; then
mount /dev/mmcblk1p4 /sharefs
fi

./sharefs &
cd -

cd /mnt
./canaan-camera-dpu.sh start otg0
./sample_dpu_uvc &
cd -
Loading

0 comments on commit 862c15c

Please sign in to comment.