Skip to content

Commit

Permalink
bsp: cvitek: fix build error for aarch64
Browse files Browse the repository at this point in the history
This patch fixed the error "bash: mksdimg.sh: No such file
or directory" when building cv18xx_aarch64.

The issue is introduced by commit "bsp: cvitek: removed
useless files after using rttpkgtool".

In addition, in order to unify the logic with riscv as much
as possible, the name of the "milkv-duo256m" directory under
cv18xx_aarch64 is uniformly changed to "duo256m".

This patch also improve the README, adding instructions to
install xz-utils.

Signed-off-by: Chen Wang <[email protected]>
  • Loading branch information
unicornx authored and mysterywolf committed Feb 4, 2025
1 parent 94952b1 commit a77a86d
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 4 deletions.
4 changes: 3 additions & 1 deletion bsp/cvitek/README.md
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,11 @@ export RTT_EXEC_PATH=/opt/riscv64-linux-musleabi_for_x86_64-pc-linux-gnu/bin
## 4.2. 依赖安装

```shell
$ sudo apt install -y scons libncurses5-dev device-tree-compiler u-boot-tools
$ sudo apt install -y scons libncurses5-dev device-tree-compiler u-boot-tools xz-utils
```

其中 u-boot-tools 包含了打包需要的 mkimage, xz-utils 包含了打包需要的 lzma。

## 4.3. 构建

异构芯片需单独编译每个核的 OS,在大/小核对应的目录下,依次执行:
Expand Down
4 changes: 2 additions & 2 deletions bsp/cvitek/cv18xx_aarch64/combine.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
C906_LITTLE_BIN_PATH=../c906_little/rtthread.bin
GEN_FIP_PATH=../output/milkv-duo256m/
DEPENDS_FILE_PATH=./prebuild/milkv-duo256m
GEN_FIP_PATH=../output/duo256m/
DEPENDS_FILE_PATH=./prebuild/duo256m

BLCP_IMG_RUNADDR=0x05200200
BLCP_PARAM_LOADADDR=0
Expand Down
25 changes: 25 additions & 0 deletions bsp/cvitek/cv18xx_aarch64/mksdimg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
set -e

PROJECT_PATH=$1
IMAGE_NAME=$2

if [ -z "$PROJECT_PATH" ] || [ -z "$IMAGE_NAME" ]; then
echo "Usage: $0 <PROJECT_DIR> <IMAGE_NAME>"
exit 1
fi

ROOT_PATH=$PROJECT_PATH/..

source ${ROOT_PATH}/tools.sh

BOARD_TYPE=`get_board_type $PROJECT_PATH`

echo "start compress kernel..."

lzma -c -9 -f -k ${PROJECT_PATH}/${IMAGE_NAME} > ${PROJECT_PATH}/dtb/${BOARD_TYPE}/Image.lzma

mkdir -p ${ROOT_PATH}/output/${BOARD_TYPE}
mkimage -f ${PROJECT_PATH}/dtb/${BOARD_TYPE}/multi.its -r ${ROOT_PATH}/output/${BOARD_TYPE}/boot.sd

rm -rf ${PROJECT_PATH}/dtb/${BOARD_TYPE}/Image.lzma
File renamed without changes.
2 changes: 1 addition & 1 deletion bsp/cvitek/cv18xx_aarch64/rtconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@
DUMP_ACTION = OBJDUMP + ' -D -S $TARGET > rtt.asm\n'
POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n'
POST_ACTION += OBJCPY + ' -O binary $TARGET Image \n' + SIZE + ' $TARGET \n'
POST_ACTION += './combine.sh && cd .. && bash mksdimg.sh ' + os.getcwd() + ' Image \n'
POST_ACTION += './combine.sh && ./mksdimg.sh ' + os.getcwd() + ' Image \n'

0 comments on commit a77a86d

Please sign in to comment.