Three structures are defined in the STM32 firmware library to correspond to these three register groups. The correspondence between these three structures and the registers in the ARM manual is as follows:
1. NVIC register group
The STM32 firmware library has the following definitions:
typedef struct
{
vu32 ISER[2];
u32 RESERVED0[30];
vu32 ICER[2];
u32 RSERVED1[30];
vu32 ISPR[2];
u32 RESERVED2[30];
vu32 ICPR[2];
u32 RESERVED3[30];
vu32 IABR[2];
u32 RESERVED4[62];
vu32 IPR[11];
} NVIC_TypeDef;
Their corresponding names in the ARM manual are
ISER = Interrupt Set-Enable Registers
ICER = Interrupt Clear-Enable Registers
ISPR = Interrupt Set-Pending Register
ICPR = Interrupt Clear-Pending Register
IABR = Active Bit Register
IPR = Interrupt Priority Registers
Each register has 240 bits, starting with Interrupt Set-Enable Register. Registers description: ISER[0] corresponds to interrupt sources 0~31, ISER[1] corresponds to interrupt sources 32~63. STM32 has only 60 interrupt sources, so there is no ISER[2:7].
Referring to the interrupt vector table in the STM32 technical reference manual, the locations of the interrupt sources are:
Position 0 - WWDG = Window Watchdog interrupt
Position 1 - PVD = PVD through EXTI Line detection interrupt
Position 2 - TAMPER = Tamper interrupt
......
Position 58 - DMA2_Channel3 = DMA2 Channel3 global interrupt
Position 59 - DMA2_Channel4_5 = DMA2 Channel4 and DMA2 Channel5 global interrupts
2. System control register group The
STM32 firmware library has the following definitions:
typedef struct
{
vuc32 CPUID;
vu32 ICSR;
vu32 VTOR;
vu32 AIRCR;
vu32 SCR;
vu32 CCR;
vu32 SHPR[3];
vu32 SHCSR;
vu32 CFSR;
vu32 HFSR;
vu32 DFSR;
vu32 MMFAR;
vu32 BFAR;
vu32 AFSR;
} SCB_TypeDef; /* System Control Block Structure */
Their corresponding names in the ARM manual are
CPUID = CPUID Base Register
ICSR = Interrupt Control State Register
VTOR = Vector Table Offset Register
AIRCR = Application Interrupt/Reset Control Register
SCR = System Control Register
CCR = Configuration Control Register
SHPR = System Handlers Priority Register
SHCSR = System Handler Control and State Register
CFSR = Configurable Fault Status Registers
HFSR = Hard Fault Status Register
DFSR = Debug Fault Status Register
MMFAR = Mem Manage Address Register
BFAR = Bus Fault Address Register
AFSR = Auxiliary Fault Status Register3
. System clock register group The
STM32 firmware library has the following definitions:
typedef struct
{
vu32 CTRL;
vu32 LOAD;
vu32 VAL;
vuc32 CALIB;
} SysTick_TypeDef;
Their corresponding names in the ARM manual are
CTRL = SysTick Control and Status Register
LOAD = SysTick Reload Value Register
VAL = SysTick Current Value Register
CALIB = SysTick Calibration Value Register
Previous article:STM32 different flash memory capacity boot file selection instructions
Next article:STM32 learning timer debugging summary
Recommended ReadingLatest update time:2024-11-16 07:39
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- TMS320C6000 C/C++ Runtime Environment Notes
- [IoT indoor environment monitor based on ESP32-S2-Kaluga-1] Development environment experience-Arduino
- Analysis of chip failure steps and failure problems
- How to pull up the 5V power supply inverter with OD output to 24V output
- [RISC-V MCU CH32V103 Evaluation] Using USART2
- 【GD32E231 DIY Contest】Snake Game
- msp432 record 1-gpio usage
- [Environmental Expert’s Smart Watch] Part 18: Downhole Mode
- Discussion on the Working Principle of UWB Technology
- The flag bit has been cleared before the general interrupt is turned on, but the interrupt still occurs. How to solve it?