mirror of
https://github.com/lukstep/raspberry-pi-pico-docker-sdk.git
synced 2026-03-26 09:25:44 +03:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5b59ba8a6a | ||
|
|
44f236e9cd | ||
|
|
002d69b364 | ||
|
|
be7e625e2b | ||
|
|
f6fd10e14b |
11
.github/workflows/sdk-ci.yml
vendored
11
.github/workflows/sdk-ci.yml
vendored
@@ -19,8 +19,12 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
- name: Build SDK
|
- name: Build SDK
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
load: true
|
load: true
|
||||||
@@ -28,7 +32,7 @@ jobs:
|
|||||||
- name: Test SDK
|
- name: Test SDK
|
||||||
run: bash ./test_sdk.sh ${{ env.TEST_TAG }}
|
run: bash ./test_sdk.sh ${{ env.TEST_TAG }}
|
||||||
- name: Log into Docker Hub
|
- name: Log into Docker Hub
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||||
@@ -39,9 +43,10 @@ jobs:
|
|||||||
images: lukstep/raspberry-pi-pico-sdk
|
images: lukstep/raspberry-pi-pico-sdk
|
||||||
- name: Push SDK image
|
- name: Push SDK image
|
||||||
if: github.event_name == 'release' && github.event.action == 'published'
|
if: github.event_name == 'release' && github.event.action == 'published'
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
|||||||
63
Dockerfile
63
Dockerfile
@@ -1,29 +1,49 @@
|
|||||||
FROM ubuntu:24.10 AS gcc_build
|
FROM ubuntu:24.04
|
||||||
|
|
||||||
# Build GCC RISC-V
|
|
||||||
COPY ./install_gcc.sh /home/install_gcc.sh
|
|
||||||
RUN bash /home/install_gcc.sh
|
|
||||||
|
|
||||||
FROM ubuntu:24.10 as sdk_setup
|
|
||||||
|
|
||||||
RUN apt-get update -y && \
|
RUN apt-get update -y && \
|
||||||
apt-get upgrade -y && \
|
apt-get upgrade -y && \
|
||||||
apt-get install --no-install-recommends -y \
|
apt-get install --no-install-recommends -y \
|
||||||
git \
|
build-essential \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
python3 \
|
cmake \
|
||||||
tar \
|
gcc-arm-none-eabi \
|
||||||
build-essential \
|
git \
|
||||||
gcc-arm-none-eabi \
|
libnewlib-arm-none-eabi \
|
||||||
libnewlib-arm-none-eabi \
|
libstdc++-arm-none-eabi-newlib \
|
||||||
libstdc++-arm-none-eabi-newlib \
|
python3 \
|
||||||
cmake && \
|
tar \
|
||||||
|
wget && \
|
||||||
apt-get clean && \
|
apt-get clean && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# RISC-V toolchain
|
||||||
|
ARG RISCV_VERSION=15.2.0-1
|
||||||
|
ARG TARGETARCH
|
||||||
|
|
||||||
|
RUN if [ "$TARGETARCH" = "arm64" ]; then \
|
||||||
|
ARCH=linux-arm64; \
|
||||||
|
elif [ "$TARGETARCH" = "amd64" ]; then \
|
||||||
|
ARCH=linux-x64; \
|
||||||
|
else \
|
||||||
|
echo "Unsupported arch: $TARGETARCH" && exit 1; \
|
||||||
|
fi && \
|
||||||
|
wget -q https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v${RISCV_VERSION}/xpack-riscv-none-elf-gcc-${RISCV_VERSION}-${ARCH}.tar.gz \
|
||||||
|
-O /tmp/riscv.tar.gz && \
|
||||||
|
tar -xzf /tmp/riscv.tar.gz -C /opt && \
|
||||||
|
rm /tmp/riscv.tar.gz
|
||||||
|
|
||||||
|
# Add toolchain to PATH
|
||||||
|
ENV PATH="/opt/xpack-riscv-none-elf-gcc-${RISCV_VERSION}/bin:${PATH}"
|
||||||
|
|
||||||
|
RUN TOOLCHAIN=/opt/xpack-riscv-none-elf-gcc-${RISCV_VERSION}/bin && \
|
||||||
|
for f in $TOOLCHAIN/riscv-none-elf-*; do \
|
||||||
|
name=$(basename $f | sed 's/riscv-none-elf/riscv32-unknown-elf/'); \
|
||||||
|
ln -s $f /usr/local/bin/$name; \
|
||||||
|
done
|
||||||
|
|
||||||
# Raspberry Pi Pico SDK
|
# Raspberry Pi Pico SDK
|
||||||
ARG SDK_PATH=/usr/local/picosdk
|
ARG SDK_PATH=/usr/local/picosdk
|
||||||
RUN git clone --depth 1 --branch 2.0.0 https://github.com/raspberrypi/pico-sdk $SDK_PATH && \
|
RUN git clone --depth 1 --branch 2.1.1 https://github.com/raspberrypi/pico-sdk $SDK_PATH && \
|
||||||
cd $SDK_PATH && \
|
cd $SDK_PATH && \
|
||||||
git submodule update --init
|
git submodule update --init
|
||||||
|
|
||||||
@@ -31,14 +51,14 @@ ENV PICO_SDK_PATH=$SDK_PATH
|
|||||||
|
|
||||||
# FreeRTOS
|
# FreeRTOS
|
||||||
ARG FREERTOS_PATH=/usr/local/freertos
|
ARG FREERTOS_PATH=/usr/local/freertos
|
||||||
RUN git clone --depth 1 --branch V11.0.1 https://github.com/FreeRTOS/FreeRTOS-Kernel $FREERTOS_PATH && \
|
RUN git clone --depth 1 --branch V11.2.0 https://github.com/FreeRTOS/FreeRTOS-Kernel $FREERTOS_PATH && \
|
||||||
cd $FREERTOS_PATH && \
|
cd $FREERTOS_PATH && \
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
|
|
||||||
ENV FREERTOS_KERNEL_PATH=$FREERTOS_PATH
|
ENV FREERTOS_KERNEL_PATH=$FREERTOS_PATH
|
||||||
|
|
||||||
# Picotool installation
|
# Picotool installation
|
||||||
RUN git clone --depth 1 --branch 2.0.0 https://github.com/raspberrypi/picotool.git /home/picotool && \
|
RUN git clone --depth 1 --branch 2.1.1 https://github.com/raspberrypi/picotool.git /home/picotool && \
|
||||||
cd /home/picotool && \
|
cd /home/picotool && \
|
||||||
mkdir build && \
|
mkdir build && \
|
||||||
cd build && \
|
cd build && \
|
||||||
@@ -46,8 +66,3 @@ RUN git clone --depth 1 --branch 2.0.0 https://github.com/raspberrypi/picotool.g
|
|||||||
make -j$(nproc) && \
|
make -j$(nproc) && \
|
||||||
cmake --install . && \
|
cmake --install . && \
|
||||||
rm -rf /home/picotool
|
rm -rf /home/picotool
|
||||||
|
|
||||||
# Install GCC RISC-V
|
|
||||||
COPY --from=gcc_build /opt/riscv/gcc14-rp2350-no-zcmp /opt/riscv/gcc14-rp2350-no-zcmp
|
|
||||||
ENV PATH="$PATH:/opt/riscv/gcc14-rp2350-no-zcmp/bin"
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ if [[ -z $1 ]]; then
|
|||||||
echo "Please provide an SDK image you want to test"
|
echo "Please provide an SDK image you want to test"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
declare -a boards=("pico" "pico_w" "pico2" "pico2_riscv")
|
declare -a boards=("pico" "pico_w" "pico2" "pico2_riscv" "pico2_w" "pico2_w_riscv")
|
||||||
|
|
||||||
|
|
||||||
docker run -d -it --name pico-sdk --mount type=bind,source="${PWD}"/test_poject,target=/home/dev "$1"
|
docker run -d -it --name pico-sdk --mount type=bind,source="${PWD}"/test_poject,target=/home/dev "$1"
|
||||||
@@ -20,6 +20,8 @@ do
|
|||||||
docker exec pico-sdk /bin/bash -c "rm -rf /home/dev/build"
|
docker exec pico-sdk /bin/bash -c "rm -rf /home/dev/build"
|
||||||
if [[ $board = pico2_riscv ]] ; then
|
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"
|
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"
|
||||||
|
elif [[ $board = pico2_w_riscv ]] ; then
|
||||||
|
docker exec -i pico-sdk /bin/bash -c "cd /home/dev && mkdir build && cd build && cmake .. -DPICO_BOARD=pico2_w -DPICO_PLATFORM=rp2350-riscv && make -j4"
|
||||||
else
|
else
|
||||||
docker exec -i pico-sdk /bin/bash -c "cd /home/dev && mkdir build && cd build && cmake .. -DPICO_BOARD=${board} && make -j4"
|
docker exec -i pico-sdk /bin/bash -c "cd /home/dev && mkdir build && cd build && cmake .. -DPICO_BOARD=${board} && make -j4"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user