Skip to content

Commit

Permalink
chore(Dockerfile): add support for rp2 build for micropython 1.22
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrand committed Oct 22, 2024
1 parent e50b196 commit e009cfb
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ dmypy.json

firmware.bin
firmware.*.bin
firmware.uf2
firmware.*.uf2
tmp
main.py
src/MANIFEST
40 changes: 40 additions & 0 deletions Dockerfile.micropython.1.22.rp2
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM --platform=linux/x86_64 python:3.11

RUN apt-get update && \
apt-get install -y git cmake wget make libncurses-dev flex bison gperf libusb-1.0-0 libusb-1.0-0-dev gcc-arm-none-eabi libnewlib-arm-none-eabi build-essential libstdc++-arm-none-eabi-newlib

WORKDIR /opt/app

ENV PATH=${PATH}:/root/.local/bin

RUN git clone https://github.com/micropython/micropython && \
cd /opt/app/micropython && \
git checkout v1.22.2 && \
git submodule update --init && \
pip install -U pip && \
pip install pyparsing==2.3.1 && \
pip install esptool==3.0 && \
pip install pyserial==3.5 && \
pip install 'click>=7.0' \
'future>=0.15.2' \
'pyelftools>=0.22' \
'idf-component-manager~=1.2' \
'urllib3<2' \
'pygdbmi<=0.9.0.2' \
'kconfiglib==13.7.1' \
'bitstring>=3.1.6,<4' \
'construct==2.10.54'

WORKDIR /opt/app/micropython

RUN sed -E 's/define LWIP_MDNS_RESPONDER([ ]+)1/define LWIP_MDNS_RESPONDER$\10/g' ports/rp2/lwip_inc/lwipopts.h

ENV BOARD RPI_PICO_W

RUN make -C mpy-cross

WORKDIR /opt/app/micropython/ports/rp2

ADD src/mdns_client modules/mdns_client

RUN bash -c "make submodules && make"
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ compile-micropython-1-21: create-data-volume

compile-micropython-1-22: create-data-volume
MICROPYTHON_VERSION=1.22 DNS_VOLUME_NAME=${DNS_VOLUME_NAME} ./build-and-copy-firmware.sh
MICROPYTHON_VERSION=1.22 DNS_VOLUME_NAME=${DNS_VOLUME_NAME} MICROPYTHON_PORT=rp2 MICROPYTHON_EXTENSION=uf2 BOARD=RPI_PICO_W ./build-and-copy-firmware.sh

compile-micropython-1-23: create-data-volume
MICROPYTHON_VERSION=1.23 DNS_VOLUME_NAME=${DNS_VOLUME_NAME} ./build-and-copy-firmware.sh
Expand Down

0 comments on commit e009cfb

Please sign in to comment.