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

Hardware Loops registers not saved/restored before being used in synchronous/asynchronous exception handler #104

Open
pascalgouedo opened this issue Apr 19, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@pascalgouedo
Copy link

When Hardware Loop feature is automatically generated and used in exception handlers, HWloop CSRs are not saved/restored.
So when returning to main program from exception handler using HWloop, it is corrupted if exception happened during main program HWloop execution.
This could happen with illegal exception, interrupt, debug code and maybe other situations.

@pascalgouedo pascalgouedo added the bug Something isn't working label Apr 19, 2024
@jeremybennett jeremybennett added enhancement New feature or request and removed bug Something isn't working labels May 29, 2024
@jeremybennett
Copy link
Collaborator

Technically not a bug, but a design decision. There are a number of options, which trade performance against flexibility when using hardware loops within interrupt handlers. For now we shall just document the issue in the GCC user manual.

@jeremybennett
Copy link
Collaborator

Documentation added in commit b34f9d1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants