Skip to main content
Associate
Nov 30, 2024 10:08 AM UTC
Question

Timer21 and USART1/USART2 interrupts are enabled and pending.

Hi 

Working on a project in which I require USART1,USART2 for serial communication.(RS485.)

I am using processor STM32L053R8.

the clock used is HSI.

Timer21 interrupt is being used to measure clock period. (to test the CPU Clock).

if the communication is started continuously, TIM21 and USART1/USART2 interrupts  both remain pending, hence the periodvalue is above the specified Range (above the HSI_LimitHigh) and hence the processor restartas with POR24.

can anybody help?

TIA

Ashwini

This topic has been closed for replies.

3 replies

Tesla DeLorean
Guru
Nov 30, 2024 10:14 AM UTC

Stuck in a different IRQ Handler or callback function?

Some sort of blocking delay or transmit function?

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
waclawek.jan
Super User
Nov 30, 2024 10:25 AM UTC

Or just too long execution time of the UART interrupt, so that continuous communication results in that interrupt "eat up" all the processor time?

Measure that execution time, e.g. by toggling a pin at the beginning and end of the actual ISR (Interrupt Service Routine).

JW

Associate
Dec 9, 2024 6:15 AM UTC

HI 

Could Solve my problem.

Was stucking in DMA IRQ Handler which has same priority as TIM21.

After changing the the DMA interrupt's priority there is no reset as periodvalue is in the range

Thanks

Regards

AshwiniKool