Skip to content

fix(esp32h21): use correct ROM addresses for libc functions#69

Merged
erhankur merged 1 commit intomasterfrom
fix/esp32h21-linker
Feb 23, 2026
Merged

fix(esp32h21): use correct ROM addresses for libc functions#69
erhankur merged 1 commit intomasterfrom
fix/esp32h21-linker

Conversation

@erhankur
Copy link
Collaborator

  • Fixed ESP32-H21 stub hang during flash write operations caused by memcpy, memmove, memcmp, strcpy, strncpy, strcmp, and strncmp being linked to inaccesable addresses (0x4fc0xxxx)
  • Updated esp32h21.rom.libc.ld to use the correct addresses (0x4000xxxx) matching ESP-IDF's esp32h21.rom.libc-suboptimal_for_misaligned_mem.ld

@erhankur erhankur changed the title fix(esp32h21): use HP ROM addresses for libc functions fix(esp32h21): use correct ROM addresses for libc functions Feb 21, 2026
@github-actions
Copy link

github-actions bot commented Feb 21, 2026

Messages
📖 🎉 Good Job! All checks are passing!

👋 Hello erhankur, we appreciate your contribution to this project!


Click to see more instructions ...


This automated output is generated by the PR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with each push event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger is not a substitute for human code reviews; it's still important to request a code review from your colleagues.
- To manually retry these Danger checks, please navigate to the Actions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫 dangerJS against 983c4e0

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a critical bug in ESP32-H21 ROM linker script that caused the stub to hang during flash write operations. The issue was caused by incorrect ROM addresses (0x4fc0xxxx) being used for seven libc functions (memcpy, memmove, memcmp, strcpy, strncpy, strcmp, strncmp), which were inaccessible. The PR updates these to the correct 0x4000xxxx address space, matching the pattern used by other similar RISC-V targets like ESP32-H2 and ESP32-C6.

Changes:

  • Updated 7 ROM libc function addresses in esp32h21.rom.libc.ld from inaccessible 0x4fc0xxxx range to correct 0x4000xxxx range
  • Maintained proper 4-byte sequential address increments consistent with other targets
  • Aligned ESP32-H21 ROM addresses with ESP-IDF's esp32h21.rom.libc-suboptimal_for_misaligned_mem.ld specification

Copy link
Collaborator

@dobairoland dobairoland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@erhankur
Copy link
Collaborator Author

@Dzarda7 @radimkarnis Not sure if you see any issue with H21 tests but this looks like a critical fix. fyi..

@erhankur erhankur merged commit 71e2cb5 into master Feb 23, 2026
34 checks passed
@erhankur erhankur deleted the fix/esp32h21-linker branch February 23, 2026 18:09
@Dzarda7
Copy link
Collaborator

Dzarda7 commented Feb 23, 2026

Thanks for letting us know, we do not support H21 yet, you can see supported targets here, that is why we did not notice. There might be more issues with it as I added its support based on what was available at that time, sorry.

Also C61 does not support large flash mode yet, but it will be resolved, I need to put 32MB flash on the devkit.

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.

4 participants