rust-embedded / cortex-m

Low level access to Cortex-M processors
Apache License 2.0
832 stars 152 forks source link

VECTACTIVE/VECTPENDING are 9 bits. #568

Open cbiffle opened 1 day ago

cbiffle commented 1 day ago

In addition to the issue described in #499, note that the ICSR VECTACTIVE/VECTPENDING bits, as well as the similarly-encoded exception bits in the xPSR, are nine bit fields, so a From<u8> impl is not appropriate.

Screenshot from ARMv7-M: 2024-11-25-135149_1455x287_scrot

ARMv6-M is restricted to 32 interrupts architecturally, so the result should be the same, though note that v6-M also defines these as nine bit fields. v7-M can have up to 496 interrupts so basically none of the current VectActive type is correct on that profile.