Skip to content

Commit

Permalink
k230 sdk release v1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
wuwentao committed Feb 5, 2024
1 parent 2ec0dd4 commit 71e1511
Show file tree
Hide file tree
Showing 370 changed files with 80,661 additions and 4,760 deletions.
Binary file added .github/images/k230_unsip_board.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/images/k230_unsip_canmv_board.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/images/software_arch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 0 additions & 63 deletions .github/workflows/docker_build.yml

This file was deleted.

169 changes: 169 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
on:
release:
types: [released]

env:
REGISTRY: ghcr.io
NAMESPACE: kendryte
IMAGE_NAME: k230_sdk

jobs:
build_docker:
name: Build-Docker
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.CR_USER }}
password: ${{ secrets.CR_PAT }}
-
name: Build docker and test
run: |
docker build -f tools/docker/Dockerfile -t ${{ env.IMAGE_NAME }} tools/docker --label "runnumber=${GITHUB_RUN_ID}"
docker run --rm ${{ env.IMAGE_NAME }}
-
name: release docker image
run: |
IMAGE_ID=${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
#[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
# [ "$VERSION" == "main" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
echo "start to tag docker image with ver $VERSION"
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
echo "start to tag docker image with latest tag"
docker tag $IMAGE_NAME $IMAGE_ID:latest
echo "start to push docker image with ver $VERSION"
docker push $IMAGE_ID:$VERSION
echo "start to push docker image with latest tag"
docker push $IMAGE_ID:latest
echo "finished to push docker image"
build_image:
name: Build-Image
needs: build_docker
runs-on: [ubuntu-latest]
timeout-minutes: 180
container:
image: ghcr.io/kendryte/k230_sdk:latest
env:
CONF: k230_${{ matrix.cfg }}_defconfig
options: --hostname release --user root
strategy:
matrix:
cfg: ["canmv", "evb"]
steps:
- name: Check for dockerenv
run: (ls /.dockerenv && echo Found dockerenv) || (echo No dockerenv)

- name: Install Nvm/Node for Actions Checkout Env
run: |
pwd
ls -alht
export NVM_DIR="$HOME/.nvm" && (
git clone https://github.com/nvm-sh/nvm.git "$NVM_DIR"
cd "$NVM_DIR"
git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)`
) && \. "$NVM_DIR/nvm.sh"
nvm install node || exit 1
node --version || exit 1
- name: Checkout Source Code
uses: actions/checkout@v4
with:
fetch-depth: 0
clean: true
submodules: recursive

- name: Download Toolchain and Setup Build Env
run: |
hostname
uname -a
whoami
pwd
git config --global --add safe.directory $PWD
git config --global --list
ls -alht
echo "download toolchain and build env"
make prepare_sourcecode || exit 1
ls -alht
mkdir -p /opt/ || exit 1
rm -rf /opt/toolchain/
echo "show toolchain"
ls -alht $PWD/toolchain/ || exit 1
echo "link ./toolchain to /opt/toolchain"
ln -s $PWD/toolchain /opt/ || exit 1
echo "show /opt/toolchain/"
ls -alht /opt/toolchain/ || exit 1
ls -alht /opt/toolchain/Xuantie-900-gcc-linux* || exit 1
ls -alht /opt/toolchain/riscv64-linux* || exit 1
- name: Build image
run: |
pwd
ls -alht
echo "start to build k230 images"
make CONF=$CONF || exit 1
echo "---show output---"
ls -alht output/${CONF}/images || exit 1
pwd
- name: Show Output Directory For Debug Purpose
run: |
pwd
ls -alht
ls -alht output/${CONF}/images/
# Copy compiled files to /github/workspace/artifacts
mkdir -p /github/workspace/artifacts
cp output/${CONF}/images/k230_${{ matrix.cfg }}* /github/workspace/artifacts/
ls -alht /github/workspace/artifacts/
shell: bash

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: artifacts-${{ matrix.cfg }}
path: /github/workspace/artifacts

upload_release:
needs: build_image
name: Release
if: ${{ startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
steps:

- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
pattern: artifacts-*
merge-multiple: true

- name: Display Structure of Artifacts Files
run: ls -R

- name: Show Working Directory For Debug Purpose
run: |
pwd
ls -alht
ls -alht artifacts || exit 0
shell: bash

- name: Upload images to Release Asset
uses: softprops/action-gh-release@v1
with:
files: artifacts/*
env:
GITHUB_TOKEN: ${{ secrets.CR_PAT }}
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ build-image:
script:
- cd $CI_PROJECT_DIR
- ls -alht
- wget -qc https://ai.b-bug.org/k510/downloads/github/sync_file.sh -O ./sync_file.sh
- 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
- echo "all file synced"
Expand All @@ -155,7 +155,7 @@ build-image:
script:
- cd $CI_PROJECT_DIR
- ls -alht
- wget -qc https://ai.b-bug.org/k510/downloads/github/sync_release.sh -O ./sync_release.sh
- wget -qc https://ai.b-bug.org/k230/test_resources/ci/release/sync_release.sh -O ./sync_release.sh
- chmod +x ./sync_release.sh
- echo $CI_COMMIT_TAG || exit 1
- echo $CONF || exit 1
Expand Down
5 changes: 5 additions & 0 deletions Kconfig.board
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ config BOARD_K230_CANMV
bool "K230 CANMV(K230PI)"
help
"CANMV(K230PI)";

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

config BOARD_NAME
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
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.7.0.tgz -O - | tar -xzC src/big/
@wget -q --show-progress $(DOWNLOAD_URL)/downloads/nncase/nncase_k230_v2.7.0.tgz -O - | tar -xzC src/big/
@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/

#big utils
@echo "download big utils"
Expand Down Expand Up @@ -142,8 +142,8 @@ 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.7.0.tar.gz -O - | tar -xzC src/reference/business_poc/dictionary_pen_poc/ ; \
cp src/reference/business_poc/dictionary_pen_poc/cidianbi_kmodel_v2.7.0/include src/reference/business_poc/dictionary_pen_poc/ -rf ; \
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/ ; \
cp src/reference/business_poc/dictionary_pen_poc/cidianbi_kmodel/include src/reference/business_poc/dictionary_pen_poc/ -rf ; \
fi;


Expand Down Expand Up @@ -220,7 +220,7 @@ mpp-apps:check_src
mkdir -p userapps/sample/fastboot_elf; \
make -C userapps/sample || exit $?; \
mkdir -p $(RTSMART_SRC_DIR)/userapps/root/bin/; \
source $(K230_SDK_ROOT)/.config; [ "$${CONFIG_BOARD_K230D}" != "y" ] && cp userapps/sample/fastboot_elf/* $(RTSMART_SRC_DIR)/userapps/root/bin/; \
source $(K230_SDK_ROOT)/.config; [ "$${CONFIG_BOARD_K230D_CANMV}" != "y" ] &&[ "$${CONFIG_BOARD_K230D}" != "y" ] && cp userapps/sample/fastboot_elf/* $(RTSMART_SRC_DIR)/userapps/root/bin/; \
cp $(RTSMART_SRC_DIR)/init.sh $(RTSMART_SRC_DIR)/userapps/root/bin/; \
cd -;

Expand Down
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ K230芯片是嘉楠科技 Kendryte®系列AIoT芯片中的最新一代SoC产品

K230-USIP-LP3-EVB是针对AI芯片K230-USIP开发,以LPDDR3为内存而设计的测评板;意在通过全面的接口覆盖K230所支持的各项特色功能的同时,为客户提供参考设计以完成自主研发。

![k230_board](https://kendryte-download.canaan-creative.com/k230/downloads/doc_images/k230_unsip_board.png)
![k230_board](./.github/images/k230_unsip_board.png)

| 序号 | 说明 |
|------------|------------------|
Expand All @@ -56,7 +56,7 @@ K230-USIP-LP3-EVB是针对AI芯片K230-USIP开发,以LPDDR3为内存而设计

CanMV-K230针对AI芯片K230-USIP开发,以LPDDR3为内存而设计的测评板,集成了常规开发板所需的HDMI和网络、WIFI/BT等接口。

![k230_Canmv-k230_board](https://kendryte-download.canaan-creative.com/k230/downloads/doc_images/k230_canmv/k230_unsip_canmv_board.png)
![k230_Canmv-k230_board](./.github/images/k230_unsip_canmv_board.png)

| 序号 | 说明 |
|------------|------------------|
Expand Down Expand Up @@ -90,7 +90,7 @@ CanMV-K230针对AI芯片K230-USIP开发,以LPDDR3为内存而设计的测评

K230 SDK 是面向K230 开发板的软件开发包,包含了基于Linux&RT-smart 双核异构系统开发需要用到的源代码,工具链和其他相关资源。

![k230_software_arch](https://kendryte-download.canaan-creative.com/k230/downloads/doc_images/software_arch.png)
![k230_software_arch](./.github/images/software_arch.png)

### 配置软件开发环境

Expand Down Expand Up @@ -166,6 +166,15 @@ k230_evb_defconfig/images

> TF卡和eMMC均可使用`sysimage-sdcard.img`镜像,或使用`sysimage-sdcard.img.gz`解压缩得到该文件。

### 预编译镜像下载

如果不希望自行编译镜像,可下载预编译镜像,直接烧录使用
1. **[main branch](https://github.com/kendryte/k230_sdk/tree/main)**: Github默认分支,作为release分支,编译release镜像自动发布至[Release](https://github.com/kendryte/k230_sdk/releases)页面.(从`v1.4`版本开始支持)
2. 预编译release镜像:请访问[嘉楠开发者社区](https://developer.canaan-creative.com/resource), 然后在`K230/Images`分类中,下载所需的镜像文件,`evb`设备下载`k230_evb*.img.gz`, `canmv`设备下载`k230_canmv*.img.gz`

> 下载的镜像默认为`.gz`压缩格式,需先解压缩,然后再烧录。
> [K230 micropython](https://github.com/kendryte/k230_canmv/)镜像所支持的功能与K230 SDK并不相同

### 烧录镜像文件

#### 烧录TF卡
Expand All @@ -176,7 +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/)工具.
如使用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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ gen_dictionary_pen_device_app()
cd ${K230_SDK_ROOT}; make dictionary_pen;
#creat dictionary_pen dir
mkdir -p ${BUILD_DIR}/images/big-core/app/dictionary_pen/
cp ${K230_SDK_ROOT}/src/reference/business_poc/dictionary_pen_poc/cidianbi_kmodel_v2.7.0/* ${BUILD_DIR}/images/big-core/app/dictionary_pen/ -rf
cp ${K230_SDK_ROOT}/src/reference/business_poc/dictionary_pen_poc/cidianbi_kmodel/* ${BUILD_DIR}/images/big-core/app/dictionary_pen/ -rf
cp ${K230_SDK_ROOT}/src/reference/business_poc/dictionary_pen_poc/include ${BUILD_DIR}/images/big-core/app/dictionary_pen/ -rf
cp ${K230_SDK_ROOT}/src/reference/business_poc/dictionary_pen_poc/build/dictionary_pen.elf ${BUILD_DIR}/images/big-core/app/dictionary_pen/ -rf

Expand Down
Loading

0 comments on commit 71e1511

Please sign in to comment.