Skip to content

Commit

Permalink
Merge #422
Browse files Browse the repository at this point in the history
422: Add ITNS field to NVIC peripheral r=adamgreig a=sphw

This PR adds the ITNS (Interrupt Target Non-secure) field to the NIVC peripheral. This field is required to write a boot loader for TrustZone-M devices, since it allows the user to use interrupts from non-secure states.

I believe I have maintained the correct padding for the next fields, but I have not tested these changes on a non M33 device. So a close review and test would be appreciated.  

Co-authored-by: Sascha Wise <[email protected]>
  • Loading branch information
bors[bot] and sphw authored Nov 12, 2022
2 parents 90c1cb6 + 9bff0c8 commit 1a21591
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/peripheral/nvic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,15 @@ pub struct RegisterBlock {
#[cfg(armv6m)]
_reserved4: [u32; 16],

_reserved5: [u32; 48],
_reserved5: [u32; 16],

#[cfg(armv8m)]
/// Interrupt Target Non-secure (only present on Arm v8-M)
pub itns: [RW<u32>; 16],
#[cfg(not(armv8m))]
_reserved6: [u32; 16],

_reserved7: [u32; 16],

/// Interrupt Priority
///
Expand Down Expand Up @@ -67,7 +75,7 @@ pub struct RegisterBlock {
pub ipr: [RW<u32>; 8],

#[cfg(not(armv6m))]
_reserved6: [u32; 580],
_reserved8: [u32; 580],

/// Software Trigger Interrupt
#[cfg(not(armv6m))]
Expand Down

0 comments on commit 1a21591

Please sign in to comment.