mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2024-10-01 01:45:38 -04:00
Add Pico SDK to docker image, for building tp1 firmware
This commit is contained in:
parent
8894eb4247
commit
604bbdbd02
@ -43,7 +43,7 @@ RUN apt-get -qq update -y \
|
||||
cmake \
|
||||
gcc-arm-none-eabi \
|
||||
libnewlib-arm-none-eabi \
|
||||
libstdc++-arm-none-eabi-newlib
|
||||
libstdc++-arm-none-eabi-newlib \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@ WORKDIR /
|
||||
RUN rm -rf /src
|
||||
|
||||
# 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
|
||||
RUN make -j$(nproc --ignore=2) \
|
||||
&& make PROGRAM_PREFIX=tillitis- install
|
||||
@ -89,10 +89,9 @@ RUN git >/usr/local/repo-commit-nextpnr describe --tags --always --dirty
|
||||
WORKDIR /
|
||||
RUN rm -rf /src
|
||||
|
||||
RUN git clone https://github.com/raspberrypi/pico-sdk.git /usr/local/picosdk
|
||||
WORKDIR /usr/local/picosdk
|
||||
RUN git checkout 1.5.0 \
|
||||
&& git submodule-update --init
|
||||
RUN git clone --branch 1.5.0 --depth 1 https://github.com/raspberrypi/pico-sdk.git /usr/local/pico-sdk
|
||||
WORKDIR /usr/local/pico-sdk
|
||||
RUN git submodule update --init
|
||||
RUN git >/usr/local/repo-commit-picosdk describe --tags --always --dirty
|
||||
WORKDIR /
|
||||
|
||||
|
@ -165,6 +165,17 @@ The programmer will update its firmware with the file and restart
|
||||
itself. After reboot the storage device will automatically be
|
||||
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
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
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:
|
||||
https://github.com/Blinkinlabs/icestorm/commits/interfaces
|
||||
https://github.com/tillitis/icestorm/commits/interfaces
|
||||
|
||||
Advantages:
|
||||
* 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.
|
||||
|
||||
@ -168,23 +168,10 @@ This command is used to put the device in bootloader mode. No data is sent durin
|
||||
|
||||
## 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
|
||||
cd ~
|
||||
git clone https://github.com/raspberrypi/pico-sdk.git
|
||||
cd pico-sdk
|
||||
git submodule update --init
|
||||
./build.sh
|
||||
|
||||
Then, clone and build this repository:
|
||||
|
||||
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.
|
||||
Once complete, the output binary is located in build/main.uf2
|
||||
|
@ -1,7 +1,11 @@
|
||||
#!/usr/bin/bash
|
||||
set -e
|
||||
|
||||
if [ -d "/usr/local/pico-sdk" ]; then
|
||||
export PICO_SDK_PATH=/usr/local/pico-sdk
|
||||
else
|
||||
export PICO_SDK_PATH=~/pico-sdk
|
||||
fi
|
||||
|
||||
BUILD_DIR=build
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user