Add Pico SDK to docker image, for building tp1 firmware

This commit is contained in:
Matthew Mets 2023-03-08 17:28:58 +01:00 committed by Michael Cardell Widerkrantz
parent 8894eb4247
commit 604bbdbd02
No known key found for this signature in database
GPG Key ID: D3DB3DDF57E704E5
4 changed files with 27 additions and 26 deletions

View File

@ -43,7 +43,7 @@ RUN apt-get -qq update -y \
cmake \ cmake \
gcc-arm-none-eabi \ gcc-arm-none-eabi \
libnewlib-arm-none-eabi \ libnewlib-arm-none-eabi \
libstdc++-arm-none-eabi-newlib libstdc++-arm-none-eabi-newlib \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
@ -59,7 +59,7 @@ WORKDIR /
RUN rm -rf /src RUN rm -rf /src
# Custom iceprog for the RPi 2040-based programmer (will be upstreamed). # Custom iceprog for the RPi 2040-based programmer (will be upstreamed).
RUN git clone -b raw_usb --depth=1 https://github.com/tillitis/icestorm /src RUN git clone -b interfaces --depth=1 https://github.com/tillitis/icestorm /src
WORKDIR /src/iceprog WORKDIR /src/iceprog
RUN make -j$(nproc --ignore=2) \ RUN make -j$(nproc --ignore=2) \
&& make PROGRAM_PREFIX=tillitis- install && make PROGRAM_PREFIX=tillitis- install
@ -89,10 +89,9 @@ RUN git >/usr/local/repo-commit-nextpnr describe --tags --always --dirty
WORKDIR / WORKDIR /
RUN rm -rf /src RUN rm -rf /src
RUN git clone https://github.com/raspberrypi/pico-sdk.git /usr/local/picosdk RUN git clone --branch 1.5.0 --depth 1 https://github.com/raspberrypi/pico-sdk.git /usr/local/pico-sdk
WORKDIR /usr/local/picosdk WORKDIR /usr/local/pico-sdk
RUN git checkout 1.5.0 \ RUN git submodule update --init
&& git submodule-update --init
RUN git >/usr/local/repo-commit-picosdk describe --tags --always --dirty RUN git >/usr/local/repo-commit-picosdk describe --tags --always --dirty
WORKDIR / WORKDIR /

View File

@ -165,6 +165,17 @@ The programmer will update its firmware with the file and restart
itself. After reboot the storage device will automatically be itself. After reboot the storage device will automatically be
disconnected. disconnected.
The firmware requires the Raspberry Pi Pico SDK:
cd ~
git clone --branch 1.5.0 https://github.com/raspberrypi/pico-sdk.git
cd pico-sdk
git submodule update --init
Note that the Docker image places the pico-sdk directory in
/usr/local. For normal development, it is usually left in the
users home directory.
## CH552 USB to Serial firmware ## CH552 USB to Serial firmware

View File

@ -3,7 +3,7 @@
This firmware allows a Raspberry Pi Pico (or any RP2040) to work as a programmer for the lattice ice40 parts. This firmware allows a Raspberry Pi Pico (or any RP2040) to work as a programmer for the lattice ice40 parts.
It has been integrated into icestorm: It has been integrated into icestorm:
https://github.com/Blinkinlabs/icestorm/commits/interfaces https://github.com/tillitis/icestorm/commits/interfaces
Advantages: Advantages:
* Cheap: RPi Pico boards are currently EUR4, FT232H boards are closer to EUR15 * Cheap: RPi Pico boards are currently EUR4, FT232H boards are closer to EUR15
@ -150,7 +150,7 @@ Data packet format:
### Read ADCs xxx ### Read ADCs
This command is used to read the analog value of analog input pins 0-2. Each value is returned as a uint32_t value representing the reading in microvolts. This command is used to read the analog value of analog input pins 0-2. Each value is returned as a uint32_t value representing the reading in microvolts.
@ -168,23 +168,10 @@ This command is used to put the device in bootloader mode. No data is sent durin
## Building the firmware ## Building the firmware
First, install the [Rasberry Pi Pico SDK](https://github.com/raspberrypi/pico-sdk.git): First, follow the details in the toolchain setup document to install
the Raspberry Pi Pico SDK. Then, the firmware can be built by running
the build script:
sudo apt install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib ./build.sh
cd ~
git clone https://github.com/raspberrypi/pico-sdk.git
cd pico-sdk
git submodule update --init
Then, clone and build this repository: Once complete, the output binary is located in build/main.uf2
cd ~
git clone https://github.com/Blinkinlabs/ice40_flasher
cd ice40_flasher
export PICO_SDK_PATH=~/pico-sdk
mkdir build
cd build
cmake ..
make
Finally, load the firmware onto the Pico using the instructions in the [usage](https://github.com/Blinkinlabs/ice40_flasher#usage) section.

View File

@ -1,7 +1,11 @@
#!/usr/bin/bash #!/usr/bin/bash
set -e set -e
if [ -d "/usr/local/pico-sdk" ]; then
export PICO_SDK_PATH=/usr/local/pico-sdk
else
export PICO_SDK_PATH=~/pico-sdk export PICO_SDK_PATH=~/pico-sdk
fi
BUILD_DIR=build BUILD_DIR=build