UART5 does not support DMA
Different peripherals require different DMA
UART4 needs to use DMA2 channel 3 or 5
For example:
void DMA1_Channel5_IRQHandler(void)
{
u16 i,j=0;
OS_ENTER_CRITICAL(); /* Tell uC/OS-II that we are starting an ISR */
OSIntNesting++;
OS_EXIT_CRITICAL();
if(DMA_GetITStatus(DMA1_IT_TC5)!= RESET)
{
DMA_ClearITPendingBit(DMA1_IT_GL5); //Clear all interrupt flags
DMA_ClearITPendingBit(DMA1_IT_TC5);
DMA_ClearFlag(DMA1_FLAG_TC5);
/*Each distance test data packet has 3 bytes (labeled A, B, C in sequence), the high bits of the first two bytes are 0, and
the high bit of the last byte is 1, marking the end of this data packet*/
memcpy(Uart_Rx_Backup,Uart_Rx,UART_RX_LEN);
if((Uart_Rx_Backup[0]&0x80) != 0)//
j=1;
else if((Uart_Rx_Backup[1]&0x80) != 0)//
j=2;
else if((Uart_Rx_Backup[2]&0x80) != 0)//
j=0;
for(i=0;i<50;i++)
{
RecorderData_FileWrite[i ]=DecodeLaseData3Byte(Uart_Rx_Backup+i*3+j);
}
}
else if(DMA_GetITStatus(DMA1_IT_HT5) == SET)
{
DMA_ClearITPendingBit(DMA1_IT_HT5);
DMA_ClearITPendingBit(DMA1_IT_GL5);
}
OSIntExit();
}
Previous article:stm32 independent watchdog clock configuration
Next article:STM32 AD DMA mode
Recommended ReadingLatest update time:2024-11-16 11:32
- 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
- Live broadcast today at 10:30 AM | How to batch upload pre-provisioned certificates from Microchip secure elements to AWS IoT
- PWM center value count
- The calculation of the operational amplifier circuit does not satisfy the virtual short and virtual disconnection problem
- Oscilloscope Simulation
- Why does MOS need to be turned on slowly when controlling a relatively high voltage?
- Evaluation summary: Beneng cost-effective ATSAMD51 evaluation board
- LCD Display IC Adjustable Three-Channel TFT, LCD DC/DC Boost Converter AAT1118
- Please help me take a look at this op amp circuit. The measured results are very strange. Can anyone analyze it?
- MCIMX6Q5EYM10AD, 21+, original authentic, 4000 pieces in stock.
- PADS high-speed routing