It uses ARM v7E-M architecture.
It a Harvard based architecture with two distinct buses for data and memory.
It has all the instruction set of M0, M1 and M3 .
It also has an additional feature set to support Floating-point Arithmetic. IEEE754 standard in single precision and double precision.
The following points are from the programming model.
There are three modes of operations:
- Thumb State
- Thread mode: Privileged
- Thread mode: Unprivileged
- Debug mode
Two thread mode are given to support a operating system. Kernel software run in priviledged mode and the user application software runs in unprivledged mode.
Unprivileged mode has some restriction on memory access.
Privileged mode has full access to system resources.
If an operating system is running and a user application needs to access the Privileged resources it has to generate an exception/interrupt and then the interrupt will be taken by the handler and put the system in privilege mode.
You can switch from privilege mode to unprivileged mode by setting nPRIV and SPSEL bit in the CONTROL register.
Just like all the other processors ARM Cotex M4 has registers and pointer registers.
The major difference is the use of two different stack pointer registers.
- Main Stack Pointer (MSP)
- Process Stack Pointer (PSP)
If application is running in privileged mode than main stack pointer will be used. And if the application is working in unprivileged the process stack pointer will be used.
General Purpose Registers:
R0 – R12 – General Purpose Register
R13 – Stack Pointer (SP) {MSP and PSP}
R14 – Link Register (LR)
R15 – program counter (PC)
Special registers:
- xPSR – {APSR, EPSR, IPSR}
- FAULTMASK
- BASEPERI
- PRIMASK
- CONTROL
There are 32 FPU registers from s0 to s31.
They group together to form a single 64-bit register. which are from D0 to D15
There is a Floating Point Status and Control Register (FPSCR).
Leave a Reply