zephyr
zephyr copied to clipboard
Building RISC-V Blinky for RPI Pico 2 Needs More Installs to run INSIDE the container (like GitLab CI does)
GitLab CI runs inside the container - so I’m not sure if lacking some of these runtimes assumes using the tools via docker as a sidecar on a laptop?
sudo docker run -it ghcr.io/embeddedcontainers/zephyr:arm-0.17.4SDK bash
#fix python tools (otherwise `west boards` does not work without jsonschema and `west build` for risc-v does not work without pyelftools)
pip install jsonschema pyelftools
#setup riscv build
apt-get update && apt-get install -y xz-utils wget #required for setup.sh
pushd /opt/toolchains/zephyr-sdk-0.17.4
./setup.sh -t riscv64-zephyr-elf
popd
#get source
cd $HOME
mkdir -p zephyrproject
cd zephyrproject
git clone https://github.com/zephyrproject-rtos/zephyr
west init -l zephyr
west update
#fix source
cat > /root/zephyrproject/zephyr/samples/basic/blinky/boards/rpi_pico2_rp2350a_hazard3.overlay << 'EOF'
/ {
aliases {
led0 = &led;
};
leds {
compatible = "gpio-leds";
led: led_0 {
gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>;
label = "LED";
};
};
};
EOF
west boards #should work
pushd zephyr
west build -b rpi_pico2/rp2350a/hazard3 samples/basic/blinky
output:
Generating files from /root/zephyrproject/zephyr/build/zephyr/zephyr.elf for board: rpi_pico2
Converted to uf2, output size: 44032, start address: 0x20000000
Wrote 44032 bytes to zephyr.uf2