Skip to content
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

Fix ESP32-C3 interrupt/exception handling #207

Merged
merged 2 commits into from
Oct 5, 2022

Conversation

bjoernQ
Copy link
Contributor

@bjoernQ bjoernQ commented Oct 5, 2022

This fixes #206 and is part of fixing esp-rs/riscv-atomic-emulation-trap#3

  • save and restore MEPC, MSTATUS
  • save MCAUSE and MTVAL in the trap-frame
  • prevent possible race-condition in critical-section's acquire implementation

This needs esp-rs/riscv-atomic-emulation-trap#4 to be merged and published first.

This will cause changes in

  • esp-backtrace not urgent since just the additional CSRs will be missing in the output
  • esp-wifi won't work anymore without changes (but changes will be trivial and seem to work fine)

@bjoernQ
Copy link
Contributor Author

bjoernQ commented Oct 5, 2022

CI fails because of the missing changes in riscv-atomic-emulation-trap - no drama

@MabezDev
Copy link
Member

MabezDev commented Oct 5, 2022

CI fails because of the missing changes in riscv-atomic-emulation-trap - no drama

Now released on crates.io :)

@bjoernQ bjoernQ marked this pull request as ready for review October 5, 2022 11:57
@bjoernQ bjoernQ requested a review from MabezDev October 5, 2022 11:57
Copy link
Member

@MabezDev MabezDev left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@stevefan1999-personal
Copy link

@MabezDev please also do this for ESP32-C2

@bjoernQ
Copy link
Contributor Author

bjoernQ commented Dec 7, 2022

Issue for applying these changes to ESP32-C2: #287

Thanks for pointing this out

@bjoernQ bjoernQ deleted the bugfix/save-restore-mepc branch December 14, 2022 09:13
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.

Fix unfortunate handling of exceptions and interrupts (ESP32-C3)
3 participants