Compile micropython from source for Badger 2040W and inky frame 4.0

I’ve been working on projects using the Raspberry PI Pico W and ran into some bugs in the CYW43 driver.
There are pull requests not yet closed in the micropython github.

I just received a Bader 2040W and an Inky Frame 4.0 in the post.
In the micropython github I do not see directories in ports/rp2/boards for either.

How can I build my own micropython interpreter for these boards?

I found a little bit about compiling micropython here: pimoroni-pico/ at main · pimoroni/pimoroni-pico · GitHub

Step 4 and step 5 seem prerequisites to compiling my own micropython.

But clearly there are files in pimoroni-pico/micropython that need to be copied into the official micropython source tree.
I see a shell script pimoroni-pico/micropython/_board/ that copies files into the ports/rp2/boards directory in the official micropython source tree.
I did figure out how to run this script.

After that I could compile using:


The resulting firmware.uf2 runs on the badger just fine.
But it does not have any pimoroni specific content like the picographics library.

I think, the contents of pimoroni-pico/micropython/modules and pimoroni-pico/micropython/modules_py need to be copied into official micropython source tree and then referenced from PIMORONI_BADGER2040W/
I’m not sure how to do this.

Pimoroni folks, your products are FOSS.
To meet that standard you need to provide the source code in a manner that your customers can compile it themselves.

Hello! Support have pointed me in the direction of this post.

There’s some info about the build process for our custom MicroPython in this issue. I’m not too well versed in the details of how it all hangs together so if you need to to know more about the nitty gritty you’re probably best posting on Github so you can talk to the software folks directly.

Alternatively, it is possible to get GitHub to do the building for you (easy mode!) by forking the repo for yourself, making your changes and then letting GitHub actions provide you with the builds under the actions tab, without having to worry about what files go where. Yezzer did a great post about how to do this for Galactic Unicorn that might be helpful: Galactic Unicorns and Custom Pimoroni Pico Firmware | by Iestyn Lloyd | Medium

To make things even more fun, we’ve just started the process of splitting the Badger / Badger W firmware off into its own repo which should (eventually!) help make the build process less opaque. If you want to take a look at the new repo you can find it here (not much in the way of documentation yet though).

1 Like

Thanks, the issue you point to was helpful.
I can now build micropython for both the badger2040w and inky_frame.

1 Like