Repository navigation
Conversation
A MakeCode Arcade handheld with an STM32F412RET6, an 8 MHz crystal, a 320x240 ILI9341 on the FSMC 8-bit bus, seven buttons, a LIS3DH-compatible accelerometer, a light sensor, battery sense, a vibration motor and a speaker. It keeps its uf2-stm32f bootloader (firmware at 0x08010000), so MakeCode games can still be installed. CIRCUITPY uses the 32 KiB in flash sectors 2-3. Stage and picogame are enabled; Stage and its ugame adapter are frozen from circuitpython-stage, whose submodule moves to the commit that adds this board's adapter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CIRCUITPY on this board is 32 KiB, too small for picogame's Python helpers. picogame-libs has a frozen/core folder for boards that freeze them, and since 0.3.4 its input and tilt helpers know this board. Add picogame-libs as a submodule at 0.3.4 and freeze that folder. To make room, turn off modules a game console doesn't need: bitbangio, gifio, jpegio, pulseio, usb_midi, atexit, getpass, locale and warnings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vegardw
added a commit
to vegardw/circuitpython
that referenced
this pull request
Nov 19, 2026
The board PR, adafruit#11915, now freezes picogame's core helpers in its second commit, so they are no longer specific to this branch. Use the PR's makefile comment, and say in the README that the PR does the same and is open as a draft. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft: waiting for a USB ID. The board still uses
1209:0001, a pid.codes test ID thatsolderparty_esp32p4_stamp_xlalso uses, so CI stops at its duplicate VID/PID check and builds nothing until the ID changes; the board builds locally (see Testing). I asked pid.codes for1209:F412(pidcodes/pidcodes.github.com#1379), but it hasn't processed requests since early October. I'll wait a bit longer for it, then ask ElecFreaks whether they can assign one. If you know another route to a USB ID for a community port to closed hardware, I'd welcome advice. The rest is ready for review.Adds the ELECFREAKS Retro Arcade, a MakeCode Arcade handheld with an STM32F412RE. It uses the STM32F412Rx support (#11896), the uf2-stm32f bootloader support (#11903) and the FSMC parallel display bus (#11908), all merged.
Problem
There is no CircuitPython build for this handheld. It has a 320×240 ILI9341 display, seven buttons, an accelerometer, a light sensor, battery sense, a vibration motor and a speaker, and ships with MakeCode Arcade on the uf2-stm32f bootloader.
Fix
A board definition:
0x08010000(a new linker script,STM32F412xE_boot.ld), and CIRCUITPY takes the 32 KiB in sectors 2–3, where MakeCode keeps its saves; those are erased when CIRCUITPY is first formatted.board.DISPLAY.ugameadapter are frozen: thefrozen/circuitpython-stagesubmodule moves to11db3fbb52(Add elecfreaks_retro_arcade python-ugame/circuitpython-stage#21), which only adds this board's adapter, so no other board's frozen code changes.alarmis off: the bootloader clearsRTC->BKP0Ron every boot, and the STMalarmmodule keeps its wake flag there.1209:0001for now; see the note at the top.A second commit freezes picogame's core Python helpers. CIRCUITPY's 26 KiB free can't hold them, and games are the point of this device. picogame-libs (MIT) has a
frozen/corefolder for boards that freeze them (18 modules, about 49 KB), and since 0.3.4 its input and tilt helpers know this board. It becomes a submodule at 0.3.4. To make room,bitbangio,gifio,jpegio,pulseio,usb_midi,atexit,getpass,localeandwarningsare off.usb_hidstays, so the console can be a USB gamepad.Testing
On a Retro Arcade, on main
d6be0e7b39, using the script below, a short rendering script and by hand:en_US421816 used, 35912 free; all 20 translations fit, the tightest (ru) with 32760 freeWHO_AM_I0x33 at 0x19), light sensor, battery sensesettings.toml), tilt withPICOGAME_TILTPAD = "retro_arcade", a picogame gameThe silent-source hang in
audiopwmiois fixed by #11889 (merged), whose test ran on this board. Without a 32 kHz crystal the RTC runs from the LSI, whichmaincalibrates at boot (#11871).How to run the test
Fetch the board's submodules, which include the new
frozen/picogame-libs, and build. Press RST with USB connected so that theARCADE-F4drive appears, and copy the UF2 to it (copy a MakeCode UF2 the same way to go back). Then copy the script below ascode.py:Its messages appear on the screen and the console. Expect PASS for the four automatic checks, then press each button when asked (an unpressed one is SKIP), and feel the vibration motor and hear the tone.
board_test.pyTrade-offs and Alternatives
alarm.ru, the largest translation). Without the second commit, 56 KiB is free and those modules stay on..mpy), so only its core folder is frozen; games copy any other module they need as.mpy. A frozen module comes before/libinsys.path, so a newer copy of one only takes effect in the CIRCUITPY root.Generative AI
I used generative AI (Claude Code and Codex) to write and test this change. I have reviewed it, and I am responsible for the code and this description.
🤖 Generated with Claude Code