Skip to content

Instantly share code, notes, and snippets.

@sonkm3
Created February 12, 2021 08:27
Show Gist options
  • Save sonkm3/bb3929cf70e29a51b90b3b8c77e15cee to your computer and use it in GitHub Desktop.
Save sonkm3/bb3929cf70e29a51b90b3b8c77e15cee to your computer and use it in GitHub Desktop.
Raspberry Pi pico用のMicroPythonを手元でビルドするメモ

install compiler

$ sudo port install arm-none-eabi-gcc arm-none-eabi-binutils

checkout sourcecode

$ git clone -b pico https://github.com/raspberrypi/micropython.git
$ cd micropython
$ git submodule update --init -- lib/pico-sdk
$ cd lib/pico-sdk
$ git submodule update --init
$ cd ../..

build

$ make -C mpy-cross
$cd ports/rp2
$ make
FROM debian:buster
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends \
cmake \
build-essential \
binutils-arm-none-eabi \
gcc-arm-none-eabi \
libnewlib-dev \
libstdc++-arm-none-eabi-newlib \
git \
ca-certificates \
python3 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
WORKDIR /raspberrypi-pico
RUN git clone -b pico https://github.com/raspberrypi/micropython.git
WORKDIR /raspberrypi-pico/micropython/
RUN git submodule update --init -- lib/pico-sdk
WORKDIR /raspberrypi-pico/micropython/lib/pico-sdk
RUN git submodule update --init
WORKDIR /raspberrypi-pico/micropython/
RUN make -C mpy-cross
WORKDIR /raspberrypi-pico/micropython/ports/rp2
RUN make
# RUN picotool info -a build/firmware.uf2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment