Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
Fixes the typo in the a1, a2, and a3 aliases of the RASR MPU register.
|
|
|
|
Signed-off-by: Daniel Egger <daniel@eggers-club.de>
|
|
Signed-off-by: Daniel Egger <daniel@eggers-club.de>
|
|
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
|
|
CC #236
Signed-off-by: Daniel Egger <daniel@eggers-club.de>
|
|
Add SCB methods to enable/disable exceptions
|
|
See #232, which this partially fixes -- there's still the question of
taking an interrupt in the midst of these sequences.
|
|
This removes the duplication of the look-up table and enforces some
safety checks with the match statement.
Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
|
|
|
|
220: Implement accessing FPSCR r=adamgreig a=bugadani
On the nRF52, sometimes it is necessary to manipulate the FPSCR register, otherwise the device wakes up immediately from sleep. (At least on this device) the FPSCR is only available through `vmrs` instructions.
I've implemented reading the register, parsing its bits and writing a raw value to the register, but let me know if I should also implement manipulation of the named bits.
I would also like to request some assistance to get this to actually build, it's not clear to me how `.s` files are compiled in this library. I'm also not certain where the actual place for this would be - in the registers, or in the `fpu` module.
Co-authored-by: Dániel Buga <bugadani@gmail.com>
Co-authored-by: Dániel Buga <daniel@revolutionrobotics.org>
|
|
225: Initial ARMv8-M MPU support. r=adamgreig a=cbiffle
The v8-M MPU is entirely different from, and incompatible with, the
earlier PMSA MPU. And so this commit does two things:
1. Makes the old RegisterBlock depend on armv6m (for M0+) and armv7m.
2. Defines a new RegisterBlock containing the right layout for v8m.
The hack for documenting fields by opting in x86-64 means the v8m
version won't appear in the docs.
226: Expose the orphaned ICTR/ACTLR registers. r=adamgreig a=cbiffle
In ARMv7-M these were floating alone in system control space, without a
unifying name. As a result, they weren't exposed in earlier versions of
this crate.
In ARMv8-M they have been given a name, the Implementation Control
Block, and more registers have been added. I've used that name for all
architecture revisions.
Co-authored-by: Cliff L. Biffle <cliff@oxide.computer>
|
|
227: ITM: don't test reserved bits in is_fifo_ready r=adamgreig a=bcantrill
This is a follow up to the discussion in #219, capturing the conclusion by @cbiffle and @adamgreig there: to indicate that the ITM FIFO is ready on FIFOREADY (only) on ARMv7-M (only) and to indicate the FIFI is ready on *either* FIFOREADY *or* DISABLED on ARMv8-M. ITM has been tested and verified on an ARMv7-M CPU (an STM32F407, a Cortex-M4) and an ARMv8-M CPU (an LPC55S69, a Cortex-M33).
Without this fix, any use of ITM will hang on ARMv8-M -- which may in fact be the root cause of #74...
Co-authored-by: Cliff L. Biffle <cliff@oxide.computer>
|
|
On ARMv7-M, bits 31:1 of the value read from STIMx are reserved, so
comparing them against zero is a bad idea.
On ARMv8-M, bit 1 has been repurposed to indicate DISABLED. This means
that the is_fifo_ready impl hangs forever when ITM is disabled on a
Cortex-M33 (for example).
Changed to test only the FIFOREADY bit on ARMv7-M, and to test either
FIFOREADY or DISABLED on ARMv8-M.
|
|
In ARMv7-M these were floating alone in system control space, without a
unifying name. As a result, they weren't exposed in earlier versions of
this crate.
In ARMv8-M they have been given a name, the Implementation Control
Block, and more registers have been added. I've used that name for all
architecture revisions.
|
|
The v8-M MPU is entirely different from, and incompatible with, the
earlier PMSA MPU. And so this commit does two things:
1. Makes the old RegisterBlock depend on armv6m (for M0+) and armv7m.
2. Defines a new RegisterBlock containing the right layout for v8m.
The hack for documenting fields by opting in x86-64 means the v8m
version won't appear in the docs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
On ARMv7-M, bits 31:1 of the value read from STIMx are reserved, so
comparing them against zero is a bad idea.
On ARMv8-M, bit 1 has been repurposed to indicate DISABLED. This means
that the is_fifo_ready impl hangs forever when ITM is disabled on a
Cortex-M33 (for example).
Changed to test only the FIFOREADY bit.
|
|
This fixes the previous commit where the #![feature()]
flag was used by mistake.
|
|
\ fixes #204
the `asm!` macro will soon be deprecated.
This changes all of the `asm!` calls to `llvm_asm!`
To my knowledge doing a direct replacement should be fine.
|
|
Some exceptions might be disabled by default which means that the
HardFault handler will be called instead of the exception handler. This
commit adds methods on the SCB peripheral that use the SHCSR register to
enable/disable exceptions.
Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
|
|
181: Add cfg to Peripheral fields r=thejpster a=hug-dev
The cfg conditional compilation attribute was only set on impl blocks of peripherals. This commit also sets it on the fields themselves to be more consistent.
Also adds Armv8-M Baseline to the blacklist of the ITM peripheral (cf rule `FMQF` of the Armv8-M ARM).
Co-authored-by: Hugues de Valon <hugues.devalon@arm.com>
|
|
180: Add Security Attribution Unit support r=thejpster a=hug-dev
The SAU is a Armv8-M core peripheral that, alongside the Implementation
Defined Attribution Unit, manages the security attribution of the memory
zones.
This driver provides abstraction to help setting the SAU up.
This pull-request adds a new dependency, `bitfield` which provides a really nice way to describe bit fields in registers with methods to access them. It makes it really easier to use/write rather than having to manually declare the shift number and mask constants.
Although `bitfield` does not have any dependency, I am well aware of the increased cost of memory its addition could cause to embedded targets.
I am really open to criticism about its use, if you would prefer me not to use it, or if you would like to see benchmarks of memory usage for some reference targets of embedded Rust 😃
Co-authored-by: Hugues de Valon <hugues.devalon@arm.com>
|
|
Update cfg attributes and code documentation to take into consideration
the new Armv8-M architecture profiles.
Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
|
|
|
|
|
|
|
|
This is an alternative proposal to #202 as suggested in
https://github.com/rust-embedded/cortex-m/pull/202#issuecomment-600017553
Signed-off-by: Daniel Egger <daniel@eggers-club.de>
|
|
201: Add UDF instruction. Closes #199. r=jonas-schievink a=adamgreig
Co-authored-by: Adam Greig <adam@adamgreig.com>
|
|
|
|
|
|
|
|
|
|
Clippy complains that the match expressions used for cfg gating could be
rewritten as a let statement, this is a false positive.
Also adds inline on two functions.
Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
|
|
Armv8-M and Armv8.1-M architecture profiles have an optional Security
Extension which provides a set of Security features.
This patch adds initial support of the Cortex-M Security Extensions but
providing support for the TT intrinsics and helper functions on top of
it in the newly added cmse module of this crate.
The code is a Rust idiomatic implementation of the C
requirements described in this document:
https://developer.arm.com/docs/ecm0359818/latest
Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
|
|
193: Make `Peripherals` non-exhaustive and improve its docs r=therealprof a=jonas-schievink
This means that it's no longer a breaking change to add fields to it, which is important since Arm is likely to add more in upcoming architectures. They could also add extensions that add peripherals.
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
|