Skip to content

cortex_m: Various fixes and cleanup - #1052

Open
tact1m4n3 wants to merge 3 commits into
mainfrom
cortex-m-fixes
Open

tact1m4n3 wants to merge 3 commits into
mainfrom
cortex-m-fixes

Conversation

@tact1m4n3

Copy link
Copy Markdown
Collaborator
  • Add dcb and dwt (register defs generated using llm, I tested only a few registers I needed)
  • Rename ExternalInterrupt to just Interrupt (also on hazard3 for consistency)
  • Fix enable, disable, set_pending, clear_pending. They previously used an or operation doing a rmw which was unnecessary and not atomic
  • Fix interrupt priorities. Now we get the priority bits from chip properties
  • Cleanup interrupt.exception: the implementation didn't work, used peripherals.ppb which didn't exist. In the future this could be added directly in the interrupt functions with a comptime switch

@mattnite

Copy link
Copy Markdown
Contributor

Please verify all the definitions by reading through the references.

To what extent did you test the rest of the code?

@tact1m4n3

tact1m4n3 commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator Author

Hey! Sorry, I should've checked the register definitions. If even this an LLM can't get right... 😄 I pushed the revised registers. The interrupt function changes I tested in my flight controller firmware where I use interrupts to schedule tasks. There was quite an annoying bug a while ago because of the rwm in the interrupt pend functions where some tasks wouldn't get scheduled because the interrupt wouldn't get reliably pended. The Interrupt renaming and exceptions up for debate, I can revert them if they are not wanted.

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