# I have successfully ported MicroPython to the PicoCalc

**URL:** <https://forum.clockworkpi.com/t/i-have-successfully-ported-micropython-to-the-picocalc/16224>\
**Category:** PicoCalc\
**Tags:** community, firmware\
**Created:** [March 22, 2025, 7:57pm UTC](https://forum.clockworkpi.com/t/i-have-successfully-ported-micropython-to-the-picocalc/16224 "2025-03-22T19:57:02Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![davb](https://avatars.discourse-cdn.com/v4/letter/d/e47774/32.png) [@davb](https://forum.clockworkpi.com/u/davb)\
**Post date:** [April 1, 2025, 6:18pm UTC](https://forum.clockworkpi.com/t/i-have-successfully-ported-micropython-to-the-picocalc/16224/22 "2025-04-01T18:18:36Z")

</div>

Is the M5StickC Plus2 _definitely_ an S3? I’ve been looking at these devices myself, but the only ones I can find use the ESP32-PICO-V3-02. The PICO (like the original ESP32, I believe, and the M5Stack NanoC6 (with its ESP32-C6FH4)) don’t have a native USB interface and rely on a USB to UART on the board. This means they don’t support the TinyUF2 bootloader (allowing flashing via a USB Mass Storage device), and with CircuitPython they won’t present a CIRCUITPYTHON drive to allow easy upload of CircuitPython code. With those ones, you’ve got to use esptool to flash CircuitPython, then use ampy or Thony to upload the Python code over an invisible connection to the REPL that just streams some commands and your code to the device.

An S3 M5StickC would tick a few boxes for me!

---

<div class="post-metadata">

**Author:** ![adcockm](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/adcockm/32/1664_2.png) [@adcockm](https://forum.clockworkpi.com/u/adcockm)\
**Post date:** [April 1, 2025, 7:26pm UTC](https://forum.clockworkpi.com/t/i-have-successfully-ported-micropython-to-the-picocalc/16224/23 "2025-04-01T19:26:24Z")

</div>

I guess it’s not. I went digging and found the same as you – it’s a ESP32-PICO-V3-02.

I’ve never used MicroPython (or CircuitPython) before starting to investigate for the PicoCalc. I’ve been using the ESP32 devices I have with C++ and Ardunio, via PlatformIO, and although the platform specific code is different for each device, the rest of the code has pretty much been the same and I haven’t been bothered by which particular processor or hardware differences there were.

So it seems like it won’t do what you’re looking for. ☹ Sorry if my own ignorance in the details of these devices got your hopes up!

---

<div class="post-metadata">

**Author:** ![davb](https://avatars.discourse-cdn.com/v4/letter/d/e47774/32.png) [@davb](https://forum.clockworkpi.com/u/davb)\
**Post date:** [April 1, 2025, 8:10pm UTC](https://forum.clockworkpi.com/t/i-have-successfully-ported-micropython-to-the-picocalc/16224/24 "2025-04-01T20:10:07Z")

</div>

It absolutely got my hopes up, but no worries 😆 I’ve done some Micropython programming before but have only recently started experimenting with CircuitPython. I like the standard library and, on fully supported boards, the simple “copy code.py to /media/CIRCUITPYTHON” concept. I get enough of casting types and managing memory in my day job, so playing with Python in my spare time is pretty low stress; I spent a few years working in Python jobs and despite the crappy CPython toolchain (venvs are a crutch for bad tooling, and that’s a hill I’ll die on), Python as a language is really nice.

I work as a sysadmin/software engineer at a university, and every now and then one of the teaching staff will decide to run an entry level class or workshop on microcontrollers. and one of the biggest stumbling blocks for less experienced students is the typical MCU toolchain (“why do I need to ‘compile’ my program?”, “why does it take tens of seconds to compile and upload it?”, “why can’t I see results instantly when I save my code, like in JavaScript frameworks with hot reload?”). No to mention, maintaining the toolchains on our lab machines can be a pain. I’m thinking of recommending some cheap dev board with CircuitPython support to my academic colleagues in the future - write your code in VSCode or whatever, and save it to /media/CIRCUITPYTHON/code.py (or, more likely, D:\code.py…) and it instantly reloads and you can see the results. Great for zero friction teaching.

It’s also easier for me to support for researchers - many of them don’t have a solid C background and fumble their way through the IoT portions of their research; I’d much rather help them focus on their research goals (usually just reading some sensor data and sending it to some MQTT broker or a web API) than have them struggle with something more powerful but much less forgiving, when they really just need to write the code once and forget about it until they publish.

Personally, though, I like it just for tinkering. Making toy programs in (neo)vim, saving them to /Volumes/CIRCUITPYTHON/code.py and having them run instantly is pretty fun. As is opening a serial console to a real (Circuit)Python REPL where I can experiment live on the device.

On a similar note, I’m quite interested in the approach the presenter in [this video](https://www.youtube.com/watch?v=YovngSLXoxw) takes for prototyping medical device software in MicroPython. He uses Jupyter Notebook with a remote MicroPython kernel. It looks like there’s a [CircuityPython equivalent](https://learn.adafruit.com/circuitpython-with-jupyter-notebooks/using-jupyter-notebooks), too.

---

<div class="post-metadata">

**Author:** ![Hatchback4](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/hatchback4/32/10076_2.png) [@Hatchback4](https://forum.clockworkpi.com/u/Hatchback4)\
**Post date:** [April 2, 2025, 5:22am UTC](https://forum.clockworkpi.com/t/i-have-successfully-ported-micropython-to-the-picocalc/16224/25 "2025-04-02T05:22:27Z")

</div>

It sounds to me that the ESP32-S3 route might make the most usable system given the inclusion of WiFi and Bluetooth. It gets better with an m5launcher-type app which given the screen size makes the picocalc a much better product than the cardputer.

---

<div class="post-metadata">

**Author:** ![BlackPointBeta](https://avatars.discourse-cdn.com/v4/letter/b/a698b9/32.png) [@BlackPointBeta](https://forum.clockworkpi.com/u/BlackPointBeta)\
**Post date:** [April 2, 2025, 11:54am UTC](https://forum.clockworkpi.com/t/i-have-successfully-ported-micropython-to-the-picocalc/16224/26 "2025-04-02T11:54:26Z")

</div>

Hi, jd3096,

I want to run pico or pico2 with micropython, but I’m interested in ESP32, so I bought the ( [ESP32-S3-Pico - Waveshare](https://www.waveshare.com/wiki/ESP32-S3-Pico)).

PicoCalc hasn’t arrived yet! ha-ha!!

I’m building a firmware for micropython, but what “st7789\_mpy” are you using?

I’m able to create the firmware by freeze .py in [russhughes/st7789\_mpy](https://github.com/russhughes/st7789_mpy), but I don’t have PicoCalc so I don’t really run that firmware, so please let me about st7789 driver.

---

<div class="post-metadata">

**Author:** ![jd3096](https://avatars.discourse-cdn.com/v4/letter/j/dfb087/32.png) [@jd3096](https://forum.clockworkpi.com/u/jd3096)\
**Post date:** [April 2, 2025, 12:23pm UTC](https://forum.clockworkpi.com/t/i-have-successfully-ported-micropython-to-the-picocalc/16224/27 "2025-04-02T12:23:29Z")

</div>

Yes, I didn’t even compile the firmware myself but directly used the pre-built firmware from this repository. The picocalc uses an ILI9488 screen. Fortunately, through my testing, I found that by only modifying the ST7789 initialization commands, the same program could be used to drive the screen. You can check how I initialized the screen in this file in my repository.  
[PICOCALC-micropython/src/utils/drivers.py at main · jd3096-mpy/PICOCALC-micropython · GitHub](https://github.com/jd3096-mpy/PICOCALC-micropython/blob/main/src/utils/drivers.py)

---

<div class="post-metadata">

**Author:** ![BlackPointBeta](https://avatars.discourse-cdn.com/v4/letter/b/a698b9/32.png) [@BlackPointBeta](https://forum.clockworkpi.com/u/BlackPointBeta)\
**Post date:** [April 2, 2025, 1:28pm UTC](https://forum.clockworkpi.com/t/i-have-successfully-ported-micropython-to-the-picocalc/16224/28 "2025-04-02T13:28:20Z")

</div>

Hi, jd3096,

Thanks!  
Somehow I think the ST7789 module will work.  
Now I just change the I2C and SPI pins for [Waveshare](https://www.waveshare.com/wiki/ESP32-S3-Pico).

And I’ll wait for PicoCalc to arrive! 😄

---

<div class="post-metadata">

**Author:** ![adcockm](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/adcockm/32/1664_2.png) [@adcockm](https://forum.clockworkpi.com/u/adcockm)\
**Post date:** [April 2, 2025, 1:54pm UTC](https://forum.clockworkpi.com/t/i-have-successfully-ported-micropython-to-the-picocalc/16224/29 "2025-04-02T13:54:12Z")

</div>

If you’d like to share a firmware binary for testing, I also have the Waveshare ESP32-S3-Pico. So far I’ve just installed the Waveshare provided (old) version of MicroPython on it, and haven’t put it in my PicoCalc yet.

I just received my PicoCalc a day ago. I’d be happy to test your build in it, if you like. I haven’t gotten around to trying the Waveshare module, as I was checking out the samples it came with on the Pico, and also played around a bit with the Pico2 W that I also bought.

I totally understand if you’d rather test it yourself when your PicoCalc arrives. 🙂

---

<div class="post-metadata">

**Author:** ![BlackPointBeta](https://avatars.discourse-cdn.com/v4/letter/b/a698b9/32.png) [@BlackPointBeta](https://forum.clockworkpi.com/u/BlackPointBeta)\
**Post date:** [April 2, 2025, 2:17pm UTC](https://forum.clockworkpi.com/t/i-have-successfully-ported-micropython-to-the-picocalc/16224/30 "2025-04-02T14:17:13Z")

</div>

Hi, adcockm,

OK, I’ll upload firmware to [another forum](https://forum.clockworkpi.com/t/waveshare-esp32-s3-pico/16389/3).

---

<div class="post-metadata">

**Author:** ![BlackPointBeta](https://avatars.discourse-cdn.com/v4/letter/b/a698b9/32.png) [@BlackPointBeta](https://forum.clockworkpi.com/u/BlackPointBeta)\
**Post date:** [April 2, 2025, 2:20pm UTC](https://forum.clockworkpi.com/t/i-have-successfully-ported-micropython-to-the-picocalc/16224/31 "2025-04-02T14:20:06Z")

</div>

Sorry, couldn’t attach the file…

---

<div class="post-metadata">

**Author:** ![adcockm](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/adcockm/32/1664_2.png) [@adcockm](https://forum.clockworkpi.com/u/adcockm)\
**Post date:** [April 2, 2025, 2:31pm UTC](https://forum.clockworkpi.com/t/i-have-successfully-ported-micropython-to-the-picocalc/16224/32 "2025-04-02T14:31:17Z")

</div>

Ah, I think the forum has limits for new users. ☹

(Not sure if those permissions increase based on number posts or time since the forum account was created, or some combination of those.)

---

<div class="post-metadata">

**Author:** ![white-round-square](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/white-round-square/32/10385_2.png) [@white-round-square](https://forum.clockworkpi.com/u/white-round-square)\
**Post date:** [April 2, 2025, 2:35pm UTC](https://forum.clockworkpi.com/t/i-have-successfully-ported-micropython-to-the-picocalc/16224/33 "2025-04-02T14:35:30Z")

</div>

> [@BlackPointBeta](#):
>
> Sorry, couldn’t attach the file…

> **[Understanding Discourse Trust Levels](https://blog.discourse.org/2018/06/understanding-discourse-trust-levels/)**
>
> The user trust system is a fundamental cornerstone of Discourse. Trust levels are a way of…

---

<div class="post-metadata">

**Author:** ![CrunchyNerdy](https://avatars.discourse-cdn.com/v4/letter/c/e79b87/32.png) [@CrunchyNerdy](https://forum.clockworkpi.com/u/CrunchyNerdy)\
**Post date:** [April 3, 2025, 1:27am UTC](https://forum.clockworkpi.com/t/i-have-successfully-ported-micropython-to-the-picocalc/16224/34 "2025-04-03T01:27:49Z")

</div>

Does anyone have MicroPython running on the Pico module (RP2040)?

---

<div class="post-metadata">

**Author:** ![jd3096](https://avatars.discourse-cdn.com/v4/letter/j/dfb087/32.png) [@jd3096](https://forum.clockworkpi.com/u/jd3096)\
**Post date:** [April 3, 2025, 1:49am UTC](https://forum.clockworkpi.com/t/i-have-successfully-ported-micropython-to-the-picocalc/16224/35 "2025-04-03T01:49:07Z")

</div>

Of course! Initially, I ported it to the RP2040, but since the RP2040 doesn’t have PSRAM, it may run out of memory when handling complex programs. So, I moved the system to the ESP32-S3 instead. For Python programs, you only need to modify one pin, which is very simple.

---

<div class="post-metadata">

**Author:** ![CrunchyNerdy](https://avatars.discourse-cdn.com/v4/letter/c/e79b87/32.png) [@CrunchyNerdy](https://forum.clockworkpi.com/u/CrunchyNerdy)\
**Post date:** [April 3, 2025, 2:00am UTC](https://forum.clockworkpi.com/t/i-have-successfully-ported-micropython-to-the-picocalc/16224/36 "2025-04-03T02:00:34Z")

</div>

How about the RP2350? Would you be interested in sharing those ports on github as well?  
**edit** …Or I can just order the ESP32-S3 I suppose.

---

<div class="post-metadata">

**Author:** ![jd3096](https://avatars.discourse-cdn.com/v4/letter/j/dfb087/32.png) [@jd3096](https://forum.clockworkpi.com/u/jd3096)\
**Post date:** [April 3, 2025, 3:12am UTC](https://forum.clockworkpi.com/t/i-have-successfully-ported-micropython-to-the-picocalc/16224/37 "2025-04-03T03:12:06Z")

</div>

At present, it seems that none of the available RP2350 boards come with PSRAM—you have to design a custom PCB to add it. Of course, it’s possible to adapt the system for all boards, but I don’t think it’s necessary, and I don’t have the time to do it. You just need to refer to the schematic and change the pin numbers accordingly.

---

<div class="post-metadata">

**Author:** ![adcockm](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/adcockm/32/1664_2.png) [@adcockm](https://forum.clockworkpi.com/u/adcockm)\
**Post date:** [April 3, 2025, 9:04am UTC](https://forum.clockworkpi.com/t/i-have-successfully-ported-micropython-to-the-picocalc/16224/38 "2025-04-03T09:04:29Z")

</div>

I tried using the official Waveshare firmware (`MicroPython v1.19.1-746-gf2de289ef-dirty on 2023-03-14; ESP32-S3-Pico with ESP32S3`):

- copied the files from @jd3096’s github to the device
- remapped the GPIO pins in all the code from the WalnutPi to the Waveshare (files `jojo.py`, `kb_test.py`, `main.py`, `mpy_scr_tst.py`)

As expected, it doesn’t contain the screen driver and gives the following error when using mpy\_scr\_test: `ImportError: no module named 'st7789'`

However, `jojo.py` successfully plays music through the PicoCalc speaker. And the `kb_test.py` shows the keycodes in the serial debug when I press keys on the keyboard.

Also, Thonny can only connect if I have the USB-C cable connected directly to the ESP32-S3-Pico. If I connect to the main PicoCalc USB-C, then I can’t get a serial connection with Thonny. Is this also how it works with the WalnutPi? Not really important, I guess, but it was interesting the passthrough didn’t work like it does on the actual Pico modules.

@BlackPointBeta, exactly how did you build the firmware with the screen driver? Did you follow the instructions at that repo ([GitHub - russhughes/st7789\_mpy: Fast MicroPython driver for ST7789 display module written in C](https://github.com/russhughes/st7789_mpy)) or did you customize it in any way? I didn’t see anything on the Waveshare website that included source code. They only posted the binary for MicroPython (which is what I used in this testing), but I’m not sure what they actually used to build it. I didn’t understand your reference to “freeze.py”. I’ve never built MicroPython before, so I’m not sure what, if anything might need to be changed for the Waveshare module during building. Or maybe everything is handled in python afterward, like the pin mappings?

---

<div class="post-metadata">

**Author:** ![adcockm](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/adcockm/32/1664_2.png) [@adcockm](https://forum.clockworkpi.com/u/adcockm)\
**Post date:** [April 3, 2025, 10:00am UTC](https://forum.clockworkpi.com/t/i-have-successfully-ported-micropython-to-the-picocalc/16224/39 "2025-04-03T10:00:00Z")

</div>

Incidentally, I hacked this together as a guide for doing the pin mappings. Probably should have made it in text, but this was easier at the time. 😉

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/clockworkpi/original/2X/2/2456501411d13225b95de572fe4c12348b9447c3.jpeg)

---

<div class="post-metadata">

**Author:** ![BlackPointBeta](https://avatars.discourse-cdn.com/v4/letter/b/a698b9/32.png) [@BlackPointBeta](https://forum.clockworkpi.com/u/BlackPointBeta)\
**Post date:** [April 3, 2025, 12:16pm UTC](https://forum.clockworkpi.com/t/i-have-successfully-ported-micropython-to-the-picocalc/16224/40 "2025-04-03T12:16:19Z")

</div>

I built micropython with SPIRAM removed based on [ESP32-S3 N16R8](https://github.com/Mythologyli/MicroPython-ESP32-S3-N16R8).  
So I am not sure if it works correctly.  
Note that ESP-IDF is v5.2.2 based on [micropython/ports/esp32 at master](https://github.com/micropython/micropython/tree/master/ports/esp32).

When I get some free time, I’ll post a few more details on how to build on the Waveshare forum.

By the way, below is my build of micropython.

```python
>>> import os
>>> os.uname()
(sysname='esp32', nodename='esp32', release='1.25.0-preview', version='v1.25.0-preview.430.g5eee5a67d.dirty on 2025-04-03', machine='Generic Board:16MB-FLASH & 2MB-PSRAM. Built-in russhughesi/ST7789_mpy module with ESP32S3-N16R2')
>>> import micropython
>>> micropython.mem_info()
stack: 704 out of 15360
GC: total: 64000, used: 1920, free: 62080, max new split: 159744
 No. of 1-blocks: 45, 2-blocks: 8, max blk sz: 18, max free sz: 3867
>>> import gc
>>> gc.mem_free()
221520
>>> gc.mem_alloc()
2384
>>> help('modules')
NotoSansMono_32 cyrilc lowmat socket
NotoSans_32 deflate machine ssl
NotoSerif_32 dht marker st7789
__main__ ds18x20 math struct
_asyncio errno meteo symbol
_boot esp micropython sys
_espnow esp32 mip/ __init__ time
_onewire espnow music tls
_thread flashbdev neopixel uasyncio
_webrepl framebuf network uctypes
aioespnow gc ntptime umqtt/robust
array gotheng onewire umqtt/simple
astrol gothger os uppmat
asyncio/ __init__ gothita platform upysh
asyncio/core greekc random urequests
asyncio/event greekcs re vfs
asyncio/funcs greekp requests/ __init__ vga1_16x16
asyncio/lock greeks romanc vga1_16x32
asyncio/stream hashlib romancs vga1_8x16
binascii heapq romand vga1_8x8
bluetooth inisetup romanp vga1_bold_16x16
btree io romans vga1_bold_16x32
builtins italicc romant webrepl
cmath italiccs scriptc webrepl_setup
collections italict scripts websocket
cryptolib json select
Plus any modules on the filesystem
>>> help(st7789)
object <module 'st7789'> is of type module
  __name__ -- st7789
  color565 -- <function>
  map_bitarray_to_rgb565 -- <function>
  ST7789 -- <class 'ST7789'>
  BLACK -- 0
  BLUE -- 31
  RED -- 63488
  GREEN -- 2016
  CYAN -- 2047
  MAGENTA -- 63519
  YELLOW -- 65504
  WHITE -- 65535
  FAST -- 0
  SLOW -- 1
  MADCTL_MY -- 128
  MADCTL_MX -- 64
  MADCTL_MV -- 32
  MADCTL_ML -- 16
  MADCTL_MH -- 4
  RGB -- 0
  BGR -- 8
  WRAP -- 3
  WRAP_H -- 2
  WRAP_V -- 1

```

---

<div class="post-metadata">

**Author:** ![adcockm](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/adcockm/32/1664_2.png) [@adcockm](https://forum.clockworkpi.com/u/adcockm)\
**Post date:** [April 5, 2025, 5:11am UTC](https://forum.clockworkpi.com/t/i-have-successfully-ported-micropython-to-the-picocalc/16224/41 "2025-04-05T05:11:03Z")

</div>

I’m not sure what I was doing wrong before (I might have just been tired!), but I’ve successfuly flashed my Waveshare ESP32-S3-Pico with the same firmware @jd3096 used on the WalnutPi Pico.

I forked the repository and updated mine with the Waveshare pinouts (and a comment to that effect in the readme):

> <https://github.com/madcock/PICOCALC-micropython/commit/2e28068fcde0c16f864a91caf034d3d1517e81a1>

The device successfully boots up, shows the logo, and gets me to a repl prompt. The keyboard works, jojo plays music, etc.

I tried to set up WebREPL, but it seems to conflict and deny connections because of the repl running on the device. I was hoping to be able to connect to it over wifi and not only be able to use the keybaord on the PicoCalc. Using Thonny with the USB-C connected directly to the Waveshare (not the main PicoCalc USB-C) works with the device running on batteries. But when using the serial connection repl in Thonny, the PicoCalc screen fills with text and the keybaord becomes unusable. Scripts still rung though, and I could show the logo, etc.

I couldn’t get some of the scripts to work, but I’m guessing they are just a work in progress? For instance, run.py gives me an error.

[Previous page](https://forum.clockworkpi.com/t/i-have-successfully-ported-micropython-to-the-picocalc/16224.md?page=1)

[Next page](https://forum.clockworkpi.com/t/i-have-successfully-ported-micropython-to-the-picocalc/16224.md?page=3)
