Repository navigation
ci(ra4m1): drop upstream PR #16409 checkout, carry USB LDO VDCEN as patch 0002 - #39
Conversation
…atch 0002 The old flow deleted the lib/micropython submodule, cloned micropython fresh, checked out upstream PR #16409 (WEACT_RA4M1_CORE board profile, open and unmerged since 2024-12) and patched main.c/mpconfigport.h with two line-addressed seds. What the XIAO RA4M1 actually needs from #16409 is only the USB LDO VDCEN enable (the board powers USB from the internal LDO: USB_CFG_LDO_REGULATOR = ENABLE in its FSP config, so USBMC.VDCEN must be set for enumeration). That 2-hunk change is now carried as micropython/patches/v1.27.0/0002-renesas-ra-usb-ldo-vdcen.patch -- verified to apply cleanly (git apply --check) on the v1.27.0 tree, after 0001, with identical anchor context (main.c:366, mphalport.h:64). The WEACT board profile half of the PR is not needed: this repo already supplies the board via boards/seeed/xiao_ra4m1, and the port natively supports BOARD_DIR. Everything else is upstream at v1.27.0: the RA4M1 family (EK_RA4M1, RA4M1_CLICKER, ra4m1_af.csv) and Makefile BOARD_DIR support. Both old seds are obsolete: main.c now ships mp_cstack_init_with_top() as-is, and MICROPY_FATFS_ENABLE_LFN is (2) (enabled, dynamic buffer). Cross-impact: 0002 only touches ports/renesas-ra files (disjoint from 0001's ports/zephyr set), is guarded by #if USB_CFG_LDO_REGULATOR == USB_CFG_ENABLE, and applies harmlessly on zephyr-port jobs that run the shared patch script. Ref Seeed-Studio#28 Co-Authored-By: Claude <noreply@anthropic.com>
The XIAO RA4M1 board dir was copied from PR #16409's WEACT_RA4M1_CORE
and still referenced the WEACT board's in-tree paths:
LD_FILES = boards/WEACT_RA4M1_CORE/ra4m1_ek.ld
FROZEN_MANIFEST ?= boards/WEACT_RA4M1_CORE/manifest.py
These only resolved because the old CI flow checked out PR #16409 (the
WEACT board then existed under ports/renesas-ra/boards/). Without it
the build fails at freeze time ('No such file or directory .../boards/
WEACT_RA4M1_CORE/manifest.py'). Point both at the board directory's
own copies via $(BOARD_DIR), which the port Makefile defines before
including mpconfigboard.mk.
Co-Authored-By: Claude <noreply@anthropic.com>
Environment change notes (pre-merge summary)What this board was building on before (the "old environment"): The workflow deleted the cd lib && rm -r micropython || true
git clone https://github.com/micropython/micropython.git
cd micropython && git submodule update --init --recursive && gh pr checkout 16409
sed -i '301,302c\ mp_cstack_init_with_top(...)' main.c
sed -i '170s/#define MICROPY_FATFS_ENABLE_LFN.*/...(1)/' mpconfigport.h
make BOARD_DIR=../../../../boards/seeed/xiao_ra4m1
What it builds on now: The repo-wide pin — Test status / caveat: ✅ CI compiles green (artifact: |
Problem (ref #28)
The workflow deleted the
lib/micropythonsubmodule, cloned micropython fresh, checked out upstream PR #16409 (WEACT_RA4M1_COREboard profile — open, unmerged since 2024-12-13), and patchedmain.c/mpconfigport.hwith two line-addressed seds. Depending on a 2-year-old open PR is the fragile pattern #28 set out to remove.What the board actually needs from #16409 — only 2 hunks
PR #16409 = 23 WEACT board-profile files + a USB LDO VDCEN enable:
boards/seeed/xiao_ra4m1(full FSP set:ra_cfg/,ra_gen/, linker, pins), and the renesas-ra Makefile natively supportsBOARD_DIR.boards/seeed/xiao_ra4m1/ra_gen/bsp_clock_cfg.hsetsUSB_CFG_LDO_REGULATOR (USB_CFG_ENABLE)— USB is powered from the internal LDO, soUSBMC.VDCENmust be set for enumeration. Carried asmicropython/patches/v1.27.0/0002-renesas-ra-usb-ldo-vdcen.patch, verified withgit apply --checkon the v1.27.0 tree after 0001 (anchors identical to the PR's:main.c:366,mphalport.h:64).Everything else is upstream at v1.27.0: RA4M1 family (
EK_RA4M1,RA4M1_CLICKER,ra4m1_af.csv),BOARD_DIRsupport. Both old seds are obsolete:main.cnow shipsmp_cstack_init_with_top()as-is;MICROPY_FATFS_ENABLE_LFNis(2)(enabled, dynamic buffer — better than the forced(1)).Cross-impact of growing the shared patch dir
0002 touches only
ports/renesas-ra/*(disjoint from 0001'sports/zephyr/*), is guarded by#if USB_CFG_LDO_REGULATOR == USB_CFG_ENABLE, and the README now documents the disjoint-file-set contract. Jobs that don't compile renesas-ra apply it inertly (and vice versa for 0001 on this job).Scope
gh pr checkout 16409+ both seds./tools/apply_micropython_patches.sh, patch 0002, README sectionmake BOARD_DIR=../../../../boards/seeed/xiao_ra4m1, toolchain, board files🤖 Generated with Claude Code