Skip to content

MicroPython: builds on upstream master b9620707e (v1.30.0-preview-322) - #683

Merged
bdbarnett merged 8 commits into
mainfrom
mp-pin-b9620707e
Nov 25, 2026
Merged

bdbarnett merged 8 commits into
mainfrom
mp-pin-b9620707e

Conversation

@bdbarnett

@bdbarnett bdbarnett commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

The firmware moves from MicroPython b70ae1aca (v1.30.0-preview-160) to upstream master b9620707e, 162 commits on. None of our patches is upstream yet, but upstream now covers four of them, so they go: 0010 (upstream 682e3f1cd adds the same mck= I2S argument), micropython-lib 0001 and 0002 (the submodule moves from ee4bb8ff to 660ddd89, which has both MIDI fixes), and micropython-s31 0005 (#19725 now passes the IDF's compile definitions, ESP_PLATFORM among them, to user C modules).

The P4's esp_hosted moves with the port from 2.7.0 to 2.13.1 (upstream 32984f052, with esp_wifi_remote 1.6.5). The lock pins the v2.13.1 tag, whose tree matches the component registry's archive file for file. Both of our esp_hosted patches go: 2.13.1 drops a packet on a failed buffer allocation on the transmit path and the receive path, which is what they did.

Resolved by hand: 0004 (upstream made runPythonAsync async; we add only { async: true }), 0007 (the PyProxyThenable generation guard moves into upstream's new _resume), 0014 (the P4 lockfile's new wifi_remote_over_eppp entry kept, our TinyUSB lines on top), 0028 (beside upstream's MCK define; upstream now reads only None as an unused pin, so an omitted ws for PDM_RX is handled in the port too, or the constructor faults), 0084 (upstream's OPENETH body under our CONFIG_ETH_USE_ESP32_EMAC) and cameraif 0001 (beside esp_wifi_remote 1.6.5). 0006 and 0017 are regenerated. micropython-s31 0001 is re-cut from #19725 at e6a738866, which upstream rebased onto this pin.

The ESP32-P4 filesystem moves. The new pin makes the P4 image (all,vision,tflite) 88,688 bytes too big for its 9 MB app slot, so the slot grows to 9,344 KB and every P4 filesystem starts 128 KB later and is 128 KB smaller: 6,976 KB at 0x930000 on the DEV-KIT and P4X-EYE, 23,360 KB at 0x930000 on the Touch-LCD-4B. A board updated from an older image comes up with an empty filesystem, so save its files first.

A second commit fixes apply_patches: micropython-lib 0005 changes lines 0004 also changes, so a second pass over a prepared tree tried 0004 again and stopped, and a build's record left 0004 out. MicropythonLibPatches.test_applies_once caught it once it stopped hardcoding the old submodule commit.

Checked so far: apply_patches.py --check and --s31 --check, update_provenance.py --check, the unit set CI runs (257 tests pass), and a unix --modules all build that reports MicroPython v1.30.0-preview.322.gb9620707e3. The esp32, S31 and webassembly builds and the board runs are still to come.

The pin moves from b70ae1aca (v1.30.0-preview-160). None of our patches is
upstream yet, but upstream now covers four of them:

- 0010 (esp32 I2S mck pin) goes: upstream 682e3f1cd adds the same mck=
  argument.
- micropython-lib 0001 and 0002 (usb-device-midi) go: the submodule moves
  from ee4bb8ff to 660ddd89, which has both.
- esp_hosted moves from 2.7.0 to 2.13.1 with the port (upstream 32984f052),
  pinned at the v2.13.1 tag, whose tree is the registry archive's. Its two
  patches go: 2.13.1 drops a packet on a failed buffer allocation on both
  the transmit and receive paths.
- micropython-s31 0005 (ESP_PLATFORM for user C modules) goes: #19725's
  new head passes the IDF's compile definitions, ESP_PLATFORM among them,
  to user C modules.

Resolved by hand: 0004 (upstream made runPythonAsync async; we add only
{ async: true }), 0007 (the PyProxyThenable generation guard moves into
upstream's new _resume), 0014 (the P4 lockfile's new wifi_remote_over_eppp
entry kept, our TinyUSB lines on top), 0028 (beside upstream's MCK define),
0084 (upstream's OPENETH body under our CONFIG_ETH_USE_ESP32_EMAC), and
cameraif 0001 (beside esp_wifi_remote 1.6.5). 0006 and 0017 regenerated.
micropython-s31 0001 is re-cut from #19725 at e6a738866, which upstream
rebased onto this pin.

MicropythonLibPatches.test_applies_once reads the submodule's commit from
the locked pin instead of naming it.

Checked with patches/apply_patches.py --check and --s31 --check, and
scripts/update_provenance.py --check.
…plied

micropython-lib's 0005 changes lines 0004 also changes, so with both on
the tree 0004 no longer reverse-applies by itself. A second pass then tried
to apply it again and stopped, and a build's record left 0004 out. Each
patch is now undone in a scratch copy of the touched files, the last one
first, so the check sees the tree as it was before the later ones.

MicropythonLibPatches.test_applies_once failed on its second pass before
this and passes now; the CI unit set passes (257 tests).
MicroPython at v1.30.0-preview-322, with esp_hosted 2.13.1 and
esp_wifi_remote 1.6.5, makes the all,vision,tflite image 9,525,872 bytes,
88,688 over the 9 MB slot. The P4 cells keep 128 KB less filesystem so the
slot grows to 9,344 KB with about 42 KB to spare: the DEV-KIT and P4X-EYE
keep 6,976 KB at 0x930000, the Touch-LCD-4B 23,360 KB at 0x930000. A board
updated from an older image comes up with an empty filesystem, so copy its
files off first; boards.md says so for each board.

The CI unit set passes (257 tests).
…the 1.30 preview

Our C modules build against both cores. The comment said the two matched.
…ds again

Upstream's mpconfig.h emits '#pragma MPCHECKS mpprint_support_ll' on GCC 12
and later whenever mp_printf handles "ll", which on Windows (32-bit long)
is always. A MinGW compiler without plugin headers never loads the plugin,
so mpy-cross and the windows port failed on an unknown pragma. 0087 emits
it only when the plugin is loaded.
Upstream's esp32 I2S now treats only None as an unused pin, so the
MP_OBJ_NULL that 0028 leaves in an omitted ws reached machine_pin_get_id
and faulted the first PDM_RX constructor (a load access fault on the
P4X-EYE). An omitted ws is now unused, and the RX/TX check looks for an
omitted ws, so ws=None still works there as upstream intends.
…boots

On a P4 before revision 3, the internal RAM above 0x4ff3afc0 joins the heap
only when main_task runs. Before the scheduler, the heap was 105,740 bytes in
this image with every module built in, and esp_hosted 2.13.1's constructor
took about 80 KB of it: two buffer pools (23,104 and 32,320 bytes) and five
5,120-byte task stacks. The main, idle and timer tasks then couldn't be
created, startup aborted, and the panic handler's RTC watchdog reset the
board every 10 s.

With the stacks in PSRAM, 25 KB of that early heap stays free. The pools
can't move: ESP-IDF 5.5's heap doesn't give PSRAM MALLOC_CAP_DMA, so
ESP_HOSTED_MEMPOOL_PREFER_SPIRAM would fall back to internal RAM anyway.

On a pre-revision-3 P4 with a C6 (--modules all): one boot, Wi-Fi joined
after a hard reset, WebREPL, a 256 KB put whose SHA-256 matched, and a 1.2 s
tone through board_config.audio_out() with 0 stalls. 201 KB of internal RAM
was free once running.
@bdbarnett
bdbarnett merged commit 5cae118 into main Nov 25, 2026
49 checks passed
@bdbarnett
bdbarnett deleted the mp-pin-b9620707e branch November 25, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant