Skip to content

Conversation

Dzarda7
Copy link
Collaborator

@Dzarda7 Dzarda7 commented Oct 9, 2025

Description

This PR adds support for UART and makes soc_utils.h part of public API as we need it in esp-flasher-stub.

Testing

Tested with esp-flasher-stub. Receive in interrupt and response works.

Checklist

Before submitting a Pull Request, please ensure the following:

  • 🚨 This PR does not introduce breaking changes.
  • All CI checks (GH Actions) pass.
  • Documentation is updated as needed.
  • Tests are updated or added as necessary.
  • Code is well-commented, especially in complex areas.
  • Git history is clean — commits are squashed to the minimum necessary.

This commit adds support for UART with interrupt possibility and
helper functions especially for RX path
@Dzarda7 Dzarda7 changed the title Feat/add uart support Feat: Add uart support Oct 9, 2025
Copy link

github-actions bot commented Oct 9, 2025

Warnings
⚠️

Some issues found for the commit messages in this PR:

  • the commit message "Apply automatic fixes from pre-commit hooks":
    • summary looks empty
    • type/action looks empty
  • the commit message "feat: Add UART support":
    • summary looks too short

Please fix these commit messages - here are some basic tips:

  • follow Conventional Commits style
  • correct format of commit message should be: <type/action>(<scope/component>): <summary>, for example fix(esp32): Fixed startup timeout issue
  • allowed types are: change,ci,docs,feat,fix,refactor,remove,revert,test
  • sufficiently descriptive message summary should be between 20 to 72 characters and start with upper case letter
  • avoid Jira references in commit messages (unavailable/irrelevant for our customers)

TIP: Install pre-commit hooks and run this check when committing (uses the Conventional Precommit Linter).

Messages
📖 You might consider squashing your 3 commits (simplifying branch history).
📖 This PR seems to be quite large (total lines of code: 2044), you might consider splitting it into smaller PRs

👋 Hello Dzarda7, 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.
- Resolve all warnings (⚠️ ) before requesting a review from human reviewers - they will appreciate it.
- Addressing info messages (📖) is strongly recommended; they're less critical but valuable.
- 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 82c64bf

@Dzarda7
Copy link
Collaborator Author

Dzarda7 commented Oct 9, 2025

@antmak @erhankur WDYT? I implemented only the stuff we need, feel free to suggest changes or request other features. Few things that came to my mind during this:

  • I am wondering what to use from ROM and what to implement again as for example uart_tx_switch changes where uart_tx_one_char sends data.
  • Should we move UART related rom wrapper functions move to uart.h?
  • There will be many functions (not only UART ones) that are common across most of the chips, only with different registers and I believe it is not good to define them for all chips and I would like to avoid using many ifdefs. Did you already talk about the way you want to solve this? I have some ideas (weak functions or some kind of structure with pointers to functions), just making sure to not do something you already decided on.

Thanks!

@erhankur
Copy link
Collaborator

@Dzarda7 check it out. #31

Similar to your proposal in esp-flasher-stub PR.

@erhankur
Copy link
Collaborator

@Dzarda7 #32
I can't add you as a reviewer.

@Dzarda7
Copy link
Collaborator Author

Dzarda7 commented Oct 11, 2025

Similar to your proposal in esp-flasher-stub PR.

Thanks, yes, that is exactly what I meant. We might want to adapt the runtime approach for some functions too I believe, for example large vs normal flashing, but there might be simpler solution for that, we will see.

I can't add you as a reviewer.

Yes, the issue is that I have no role in this repo. Thanks for letting me know.

@Dzarda7 Dzarda7 mentioned this pull request Oct 13, 2025
@antmak
Copy link
Collaborator

antmak commented Oct 15, 2025

@Dzarda7

In view of #32 some points become clearer

I am wondering what to use from ROM and what to implement again as for example uart_tx_switch changes where uart_tx_one_char sends data.

I'm not aware many details, but I'd take newer chips into account, as their implementation is usually more mature. So looks good to implement things in common/, the rest in chip-specific dirs. Although during development, it may be convenient to implement some chips and then extract common parts.

Should we move UART related rom wrapper functions move to uart.h?

If it is not a stub-lib interface, then it makes sense

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.

3 participants