-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
126 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/bash | ||
|
||
RET_VALUE=$? | ||
RED='\033[0;31m' | ||
NC='\033[0m' # No Color | ||
|
||
apt-get update -y && \ | ||
apt-get upgrade -y && \ | ||
apt-get install -y autoconf automake autotools-dev curl python3 python3-pip libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev ninja-build git cmake libglib2.0-dev libslirp-dev | ||
|
||
|
||
if [ $RET_VALUE != 0 ]; then | ||
echo "${RED}Instalation failed!${NC}" | ||
exit 1 | ||
fi | ||
|
||
mkdir -p /opt/riscv/gcc14-rp2350-no-zcmp | ||
|
||
chown -R "$(whoami)" /opt/riscv/gcc14-rp2350-no-zcmp | ||
|
||
git clone --depth 1 https://github.com/riscv/riscv-gnu-toolchain /home/riscv-gnu-toolchain | ||
|
||
if [ $RET_VALUE != 0 ]; then | ||
echo "${RED}Cloning RISC-V repo failed!${NC}" | ||
exit 1 | ||
fi | ||
|
||
cd /home/riscv-gnu-toolchain || exit | ||
|
||
git clone --depth 1 https://github.com/gcc-mirror/gcc gcc-14 -b releases/gcc-14 | ||
|
||
if [ $RET_VALUE != 0 ]; then | ||
echo "${RED}Cloning GCC repo failed!${NC}" | ||
exit 1 | ||
fi | ||
|
||
./configure --prefix=/opt/riscv/gcc14-rp2350-no-zcmp \ | ||
--with-arch=rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb --with-abi=ilp32 \ | ||
--with-multilib-generator="rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb-ilp32--;rv32imac_zicsr_zifencei_zba_zbb_zbs_zbkb-ilp32--" \ | ||
--with-gcc-src=`pwd`/gcc-14 | ||
|
||
if [ $RET_VALUE != 0 ]; then | ||
echo "${RED}Configure failed!${NC}" | ||
exit 1 | ||
fi | ||
|
||
make -j$(nproc) | ||
|
||
cd /home || exit | ||
|
||
rm -rf /home/riscv-gnu-toolchain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,47 @@ | ||
#! /usr/bin/env bash | ||
|
||
RED="\e[31m" | ||
GREEN="\e[32m" | ||
NC="\e[0m" | ||
|
||
if [[ -z $1 ]]; then | ||
echo "Please provide an SDK image you want to test" | ||
fi | ||
|
||
docker run -d -it --name pico-sdk --mount type=bind,source=${PWD}/test_poject,target=/home/dev $1 | ||
docker exec pico-sdk /bin/sh -c "cd /home/dev && mkdir build && cd build && cmake .. && make -j4" | ||
docker exec pico-sdk /bin/sh -c "picotool" | ||
docker container kill pico-sdk | ||
docker container rm pico-sdk | ||
|
||
docker run -d -it --name pico-sdk --mount type=bind,source=${PWD}/freertos_test_project,target=/home/dev $1 | ||
docker exec pico-sdk /bin/sh -c "cd /home/dev && mkdir build && cd build && cmake .. && make -j4" | ||
docker exec pico-sdk /bin/sh -c "picotool" | ||
docker container kill pico-sdk | ||
docker container rm pico-sdk | ||
declare -a boards=("pico" "pico_w" "pico2" "pico2_riscv") | ||
|
||
for board in "${boards[@]}" | ||
do | ||
echo "---- $board build test ----" | ||
docker run -d -it --name pico-sdk --mount type=bind,source="${PWD}"/test_poject,target=/home/dev "$1" | ||
docker exec pico-sdk /bin/bash -c "rm -rf /home/dev/build" | ||
if [[ $board = pico2_riscv ]] ; then | ||
docker exec -i pico-sdk /bin/bash -c "cd /home/dev && mkdir build && cd build && cmake .. -DPICO_BOARD=pico2 -DPICO_PLATFORM=rp2350-riscv && make -j4" | ||
else | ||
docker exec -i pico-sdk /bin/bash -c "cd /home/dev && mkdir build && cd build && cmake .. -DPICO_BOARD=${board} && make -j4" | ||
fi | ||
if [ $? != 0 ]; then | ||
echo -e "${RED}----- Test failed -----${NC}" | ||
exit 1 | ||
fi | ||
docker container kill pico-sdk | ||
docker container rm pico-sdk | ||
echo "${GREEN}----- Test passed -----${NC}" | ||
done | ||
|
||
|
||
# for board in "${boards[@]}" | ||
# do | ||
# echo "FreeRTOS $board build test" | ||
# docker run -d -it --name pico-sdk --mount type=bind,source=${PWD}/freertos_test_project,target=/home/dev $1 | ||
# if [[ $board -eq "pico2_riscv" ]] ; then | ||
# docker exec pico-sdk /bin/bash -c "cd /home/dev && mkdir build && cd build && cmake .. -DPICO_BOARD=pico2 -DPICO_PLATFORM=rp2350-riscv && make -j4" | ||
# else | ||
# docker exec pico-sdk /bin/bash -c "cd /home/dev && mkdir build && cd build && cmake .. -DPICO_BOARD=${board} && make -j4 && cd .. && rm -rf build" | ||
# fi | ||
# docker exec pico-sdk /bin/bash -c "rm -rf /home/dev/build" | ||
# docker container kill pico-sdk | ||
# docker container rm pico-sdk | ||
# rm -rf ./test_poject/build/ | ||
# done | ||
|