Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@asanza
Copy link

@asanza asanza commented Jan 7, 2025

This commit implements the execution priority as defined in the armv7-m architecture reference manual.

There was a bug where the group priority for reset, nmi and hardfault was not being ignored as specified in the ARMV7-M Arch Reference Manual. Version E. Page B1-157. Here it is defined that the group priority for Hardfault, NMI and Reset is -1, -2 and -3 respectively, regardles of the value of PRIGROUP.

Related: #54

This commit implements the execution priority as defined in the
armv7-m architecture reference manual.

There was a bug where the group priority for reset, nmi and hardfault
was not being ignored as specified in the ARMV7-M Arch Reference Manual.
Version E. Page B1-157. Here it is defined that the group priority
for Hardfault, NMI and Reset is -1, -2 and -3 respectively, regardles
of the value of PRIGROUP.

Signed-off-by: Diego Asanza <[email protected]>
@jjkt
Copy link
Owner

jjkt commented Jan 8, 2025

Now looking at ARM V6m and ARM v7m reference manuals side by side I note that the ARM v6m implementation is likely broken (not related to this PR directly though).

Interesting that the ExecutionPriority() pseudocode implementation as is does not result in correct operation regarding NMI, HARDFAULT and RESET. In make_default_exception_priorities() they are configured with correct priority numbers...

@jjkt jjkt merged commit c4d2b04 into jjkt:master Jan 8, 2025
1 check passed
@asanza
Copy link
Author

asanza commented Jan 9, 2025

Btw, i think the way the exceptions are handled in the simulator will need probably some rework.

Now looking at ARM V6m and ARM v7m reference manuals side by side I note that the ARM v6m implementation is likely broken (not related to this PR directly though).

Interesting that the ExecutionPriority() pseudocode implementation as is does not result in correct operation regarding NMI, HARDFAULT and RESET. In make_default_exception_priorities() they are configured with correct priority numbers...

Yes, i was thinking the same. But I don't yet the architecture of the simulator good enough to start doing more involved changes.
The main difference between armv6-m and v7-m seems to be that there are extra fault registers that are affected in the v7-m architecture.

specifically, the hfsr is available in v7-m but not in v6-m. The same with others.

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