Test environment, STM32L476, when the HAL library uses UART, an ORE error occurs in the interrupt flag register, as described below:
Cause of code error:
1. Initialize the serial port, uart_USB_init(); this function does not start the interrupt
2. Delay 3000S, during which the computer sends data to the serial port every 50ms.
3. Start interrupt reception. HAL_NVIC_SetPriority(USART_IRQn, 5, 1);
HAL_NVIC_EnableIRQ(USART_IRQn);
4. An ORE error occurred.
After analysis, there may be two reasons. After the serial port is initialized, the serial port receives data (not processed), and then opens the interrupt to receive data again. Therefore, there is a difference between the two reception interrupt and non-interruption processing. It is also possible that the first non-interruption reception data is not processed.
Solution: Modify the above order
1. Delay 3000S, during which the computer sends data to the serial port every 50ms.
2. Initialize the serial port, uart_USB_init(); this function does not start the interrupt
3. Start interrupt reception. HAL_NVIC_SetPriority(USART_IRQn, 5, 1);
HAL_NVIC_EnableIRQ(USART_IRQn);
Specifically, serial port initialization and interrupt enable should be placed closely together.
Previous article:STM32 DMA receives data from the serial port
Next article:What about STM32 development reset
Recommended ReadingLatest update time:2024-11-16 13:22
- 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
- Low Power Consumption Design Strategy for Single Chip Microcomputer System
- This picture can explain AD DC very well.
- Ten PLCs detect heater disconnection circuit diagram
- AD16 suddenly cannot import DDB files
- Why Use a 24-Bit Converter Instead of Multiple 12-Bit Devices
- Sell NI arbitrary waveform board and genuine burner
- Chapter 4 GD32VF103C START RISC-V and Corex-M3 instruction test
- FPGA_100 Days Tour_Binary to Gray Code to Binary
- [Silicon Labs BG22-EK4108A Bluetooth Development Evaluation] + Development Board Power Consumption Detection and Comparison
- It's 2022, and Japan is still using 3.5-inch floppy disks?