Skip to content

Instantly share code, notes, and snippets.

@br0kenpixel
Created September 24, 2022 15:22
Show Gist options
  • Save br0kenpixel/27d504d355afc2bd152d8a2a000629bd to your computer and use it in GitHub Desktop.
Save br0kenpixel/27d504d355afc2bd152d8a2a000629bd to your computer and use it in GitHub Desktop.
Setting up a build environment for building MicroPython for Raspberry Pi Pico (W) and Arduino Nano RP2040 Connect.
Source: https://forum.micropython.org/viewtopic.php?f=21&t=9965
1) Clone the repo:
a) git clone https://www.github.com/micropython/micropython
b) Specific version:
i.) git clone -b v1.19.1 https://github.com/micropython/micropython.git
Note: v1.19.1 does not work! Use latest instead.
Note: --recursive is not needed
2) Build mpy-cross:
cd micropython/
make -j4 -C mpy-cross/
3) Get submodules:
git submodule update --init -- lib/pico-sdk
git submodule update --init -- lib/tinyusb
git submodule update --init -- lib/mynewt-nimble #For RP2040 Connect
4) Set up the Pico SDK:
cd lib/pico-sdk
git submodule update --init
cd ../..
cd ports/rp2
5) Build submodules:
a) make -j4 BOARD=PICO submodules
b) make -j4 BOARD=ARDUINO_NANO_RP2040_CONNECT submodules
6) Build:
a) make -j4 BOARD=PICO
b) make -j4 BOARD=ARDUINO_NANO_RP2040_CONNECT
----------------------------------------------------------------
Quick-one-liners:
The long commands below will run everything in this guide automatically.
A clean build will also be made. If all commands execute successfully, you'll see a green "Setup done" message.
1) Generic Pico board:
git clone https://www.github.com/micropython/micropython && cd micropython/ && make -j4 -C mpy-cross/ && git submodule update --init -- lib/pico-sdk && git submodule update --init -- lib/tinyusb && git submodule update --init -- lib/mynewt-nimble && cd lib/pico-sdk && git submodule update --init && cd ../.. && cd ports/rp2 && make -j4 BOARD=PICO submodules && make -j4 BOARD=PICO && echo -e "\n\n\e[1m\e[1;37m-> \e[1;32m\e[1mSetup done\! Thank you.\e[0m"
1) RP2040 Connect:
git clone https://www.github.com/micropython/micropython && cd micropython/ && make -j4 -C mpy-cross/ && git submodule update --init -- lib/pico-sdk && git submodule update --init -- lib/tinyusb && git submodule update --init -- lib/mynewt-nimble && cd lib/pico-sdk && git submodule update --init && cd ../.. && cd ports/rp2 && make -j4 BOARD=ARDUINO_NANO_RP2040_CONNECT submodules && make -j4 BOARD=ARDUINO_NANO_RP2040_CONNECT && echo -e "\n\n\e[1m\e[1;37m-> \e[1;32m\e[1mSetup done\! Thank you.\e[0m"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment