MicroPython Experiment

I substantially wrapped this up a couple of weeks ago, but kept tweaking it a little here and there. It’s time to declare it done, or at least as done as an experimental project can be. GitHub repo below.

First of all, kudos to @torwag for coming up with the notion six months ago in this thread. Alas, I didn’t find that until after I “rediscovered” the conclusion that a bog-standard MicroPython RP2 build would work just fine on the BP5. Fortunately I didn’t waste too much time on this, and there are some advantages to compiling a custom build, ranging from minor to significant.

While there are several ways one could make MicroPython work with the BP5, this experiment took the path of least resistance. I took advantage of the applicable built-in device classes of MicroPython, and didn’t do any customizations other than MicroPython classes to represent the BP5 and its various interfaces. These are basically wrappers to the build-in interfaces to deal with unique aspects of the BP5 hardware. There are a few missing interfaces, like I2C and the NAND flash memory. This details will be forthcoming in an article I’m wrapping up this week.

This is not meant to be a ready-for-production project, but just an experiment to demonstrate MicroPython on the BP5. If this seems promising to folks, we can discuss here on these forums or in the issues of the repo what would be the best path forward. I have several ideas in mind.

-Chris “The Stumbler” Lott
Sacheon City, South Korea

GitHub repository:

https://github.com/thestumbler/buspirate5-micropython-experiment

4 Likes

This is awesome! A new com port attaches with a python environment :slight_smile:

I gave it a try, but its my first try with MicroPython and I’m not sure what to expect. I uploaded the .uf2, and then it seems like a drive should appear where the contents of the /flash/ folder are uploaded. Maybe there is a loader utility?

The Micron MT29F1G01AB, 1 Gib / 128 MiB, SPI-connected NAND flash memory is not currently supported. Several attempts were made to access this memory using a couple of standard libraries without success. Getting this to work is just a matter of additional time and focus.

That could be a royal pain. The NAND has a quirky interface, I’m not sure if it is standard, but it might be. The real issue, if you want to read the existing contents of the NAND, will be implementing the dhara wear leveling, error detection, bad block marking stuff. I briefly looked at how MicroPython interfaces with C code, and probably that is the best bet.

I’m sorry, I clicked through and saw you invited me to the repo and it expired.

There’s still a flash drive implemented in the “normal” flash ship. That’s all I used and it worked fine. I know how to fix the NAND but out that off to get the whole thing going.

There are several work flows for MP. I typically use rshell. I want to check out mpremote soon. Also Thonny is very good option, and it’s easy to set up in VSCODE if you want.

1 Like