Skip to content

esp32: drop dead C5 upload hack; fix samd cross-family package deletion - #122

Open
cumin777 wants to merge 3 commits into
Seeed-Studio:devfrom
cumin777:refactor/esp32-drop-dead-c5-upload-hack
Open

cumin777 wants to merge 3 commits into
Seeed-Studio:devfrom
cumin777:refactor/esp32-drop-dead-c5-upload-hack

Conversation

@cumin777

@cumin777 cumin777 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Two small fixes, rebased onto the main baseline (the previous dev-only history is dropped; see #121 for the architecture that supersedes it):

  1. Drop the dead esp32c5_upload pre-action — the bootloader offset 0x2000 is already generated by the framework package's offset matrix (esp32c5/esp32p4 = 0x2000) and the espidf builder's upload.bootloader_offset board key. Verified via envdump on seeed-xiao-esp32-c5.

  2. Stop samd deleting other families' uploader packages (port of d466200 to the function form) — samd's uploader pruning loop deleted esp/renesas/nrf uploaders from the shared packages dict because samd's own uploaders carry no type field. The packages are optional and never install for samd builds; the loop bought nothing and broke later in-process cross-family configuration.

Found in review during #121.


stm32: GPIO example D8 pad fix + D15→D18 net rename follow-up (15715f9)

  1. Fix zephyr-gpio-all-pins-cdc D8 pad mapping: PA15 → PE2 — the example still drove PA15 (the BAT_EN net) as "D8"; the board dtsi and the xiao-stm32c5-test-plan sample fixed this to PE2 (schematic D8 net) but the example copy was never updated, so CI-built firmware tested the wrong pad.

  2. Follow the board re-spin that renamed the PB14 header net and silkscreen D15 → D18:

    • Example displays D18, accepts both d18 and d15 commands (matched before the generic dN path, since bare numeric 18 is BOOT0), so scripts for either board revision keep working.
    • seeed_xiao_connector.dtsi / xiao_stm32c5.dts comments updated; the connector gpio-map index stays 15 for API compatibility.

@cumin777
cumin777 marked this pull request as ready for review October 22, 2026 03:29
@baorepo

baorepo commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

AI Code Review 审查结论

项目 内容
结论 建议修改
任务 #56 · 544da12

Top 3 重点问题

  1. [低][新增] 删除 uploader 精简逻辑后,本函数中上方那句 board = self.board_config(variables.get("board")) 已 — platform_cfg/samd_cfg.py L10
    • 删除 uploader 精简逻辑后,本函数中上方那句 board = self.board_config(variables.get("board")) 已不再被任何代码读取(原先只用于取 upload.protocol),变成了未使用变量,同时每次配置仍会多解析一次板级 manifest。建议把该赋值一并删除;如果保留它是为了在 board 不存在时提前抛错做校验,请补一行注释说明意图,避免后续被误判为无用代码。
    • 处置:待确认

范围统计

范围统计:—


由 AI Code Review 自动生成并更新;请勿手动删除本标记评论。

cumin777 and others added 2 commits October 23, 2026 10:25
The esp32c5_upload pre-action rewrote a 0x0 bootloader offset to 0x2000
in UPLOADERFLAGS before upload. It is dead code on both framework paths:

- Arduino: the framework package's tools/pioarduino-build.py generates
  FLASH_EXTRA_IMAGES with bootloader offsets 0x1000 (esp32/s2), 0x2000
  (esp32p4/esp32c5), 0x0 (others), so esp32c5 already uploads at 0x2000.
- ESP-IDF: builder/frameworks/espidf.py resolves the offset through the
  upload.bootloader_offset board manifest key with the same
  esp32c5/esp32p4 = 0x2000 default matrix.

Verified on seeed-xiao-esp32-c5 (Arduino): build succeeds and an envdump
of UPLOADERFLAGS shows bootloader.bin at 0x2000 with the pre-action
removed. No hardware upload was performed.

Co-Authored-By: Claude <noreply@anthropic.com>
Port of d466200 (from the FamilyConfig line, which this tree does not
carry) back to the function form: remove the type=uploader pruning loop
entirely. samd's own uploaders carry no type field, so the loop
collected and deleted esp/renesas/nrf uploaders from the shared
packages dict, breaking later in-process configuration of those
families; the deleted packages are optional and never install for samd
builds anyway. Also drops two stray debug prints.

Co-Authored-By: Claude <noreply@anthropic.com>
@cumin777
cumin777 force-pushed the refactor/esp32-drop-dead-c5-upload-hack branch from 140f78e to 8cb7f05 Compare October 23, 2026 02:27
@cumin777 cumin777 changed the title esp32: drop the dead esp32c5 bootloader-offset upload pre-action esp32: drop dead C5 upload hack; fix samd cross-family package deletion Oct 23, 2026
cumin777 added a commit that referenced this pull request Oct 23, 2026
dev is reset to main's tree; only the version floor moves to 1.1.2
(above the published 1.1.1 tag, per check-dev-version). The #119
FamilyConfig rework is superseded by #121 (families/ registry +
upstream integration); its one real bug fix travels in #122.

Co-Authored-By: Claude <noreply@anthropic.com>
The gpio-all-pins-cdc example still mapped D8 to PA15 (the BAT_EN net);
the board dtsi and the xiao-stm32c5-test-plan sample fixed this to PE2
(schematic D8 net) but the example was never updated. Port the fix.

The board re-spin renamed the PB14 header net and silkscreen from D15
to D18. The example now displays D18 and accepts both d18 and d15
commands (matched before the generic dN path, since bare numeric 18 is
BOOT0); board-file comments follow the rename. The connector gpio-map
index stays 15 for API compatibility.

Co-Authored-By: Claude <noreply@anthropic.com>
@cumin777
cumin777 force-pushed the refactor/esp32-drop-dead-c5-upload-hack branch from 15715f9 to 544da12 Compare October 26, 2026 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants