Skip to content

Optionally implement defmt::Format #335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

bjoernQ
Copy link
Contributor

@bjoernQ bjoernQ commented Jul 31, 2025

Not a huge thing but since Debug is already implemented on these two types, having defmt::Format would be useful (at least for us and at least for TrapFrame ).

Given defmt is 1.0 this shouldn't be a problem, I guess. Let me know if you want something changed here or if you in general dislike the optional dependency.

@bjoernQ bjoernQ requested a review from a team as a code owner July 31, 2025 15:11
Copy link
Contributor

@romancardenas romancardenas left a comment

Choose a reason for hiding this comment

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

LGTM! defmt is a very typical dependency and feature, so I guess it is OK to merge this PR. Thank you!

@romancardenas
Copy link
Contributor

By the way, @bjoernQ , are you planning to use riscv-rt's trap frame? I was planning to work on a mechanism to skip it and let crates such as esp-riscv-rt define their own trap handling workflow, but if you are planning to migrate to our trap frame, then it is not necessary.

@bjoernQ
Copy link
Contributor Author

bjoernQ commented Jul 31, 2025

We reduced our TrapFrame to the one you define - so we can use it.

I guess for now we would need our own trap-handler still - I am wondering how we could avoid that.

This is the draft PR on esp-hal: esp-rs/esp-hal#3857

@romancardenas
Copy link
Contributor

Looks amazing!

You can use the #[riscv::core_interrupt] macro over your enumeration of interrupt sources. The macro is supposedly able to create the vector table and the default _start_INTERRUPT_trap symbols. I will take a look and find if we need to adapt something.

@romancardenas romancardenas added this pull request to the merge queue Aug 1, 2025
Merged via the queue into rust-embedded:master with commit fcde9ff Aug 1, 2025
139 checks passed
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