2018-04-10 11:24 PM
Hi,
New in STM32. I have Enabled only UART Receiver interrupt it's working fine
but some time continuously execute ISR without incoming data and Disable OVERRUN.
Thanks and Regards
vitthal
2018-04-10 11:35 PM
Check for other ISR bits or error status being flagged.
2018-04-11 01:40 AM
I have Disable All Error flags intrrupt
2018-04-11 01:48 AM
Check the error flags INSIDE the interrupt handler.
And NEVER spend more time in the handler than the transmission of a byte takes.
2018-04-11 01:55 AM
Hi,
if(LPUART1->ISR & 1<<0){
LPUART1->ICR|=(1<<0); Parity error clear } if(LPUART1->ISR & 1<<1){ LPUART1->ICR|=(1<<1); Framing error clear } if(LPUART1->ISR & 1<<3){ LPUART1->ICR|=(1<<3); Noise detected clear } if(LPUART1->ISR & 1<<2){ LPUART1->ICR|=(1<<2); Overrun error clear}this Right or not
2018-04-11 03:32 AM
if(
LPUART1
->ISR & 1<<0){ ...Looks like you are using a L4xx device, which I never worked with.
For projects with L051, F30x and F40x devices, I used to clear errors in a similar way, directly in the status register.
The register name differs between device families, so check the Reference Manual for your part.
And, as said: don't spend long times in interrupt routines.
Calling printf() in an interrupt handler is a perfect example.
Also, there is a known race condition in Cortex M devices.
Don't clear interrupt flags as the very last action in the handler, this might cause a re-entry as well.
2018-04-11 03:55 AM
this STM32l071
2018-04-11 05:39 AM
Not sure what distinguishes a LPUART from a normal UART - check with the RM.
... but some time continuously execute ISR without incoming data and Disable OVERRUN.
Indicates either an unhandled error condition (noise or corruption on the line) or overrun (your handler takes too long).
Your idea of clearing the error flag might work, but check with a debugger for the actual cause.
A bugfix assumes you identified and confirmed the issue properly.
2018-04-11 05:48 AM
I have not Enabled any ERROR INTERRUPT
2018-04-11 06:41 AM
Ok, and what statuses to you see on this repeated calling? Hard to see from here. What do the registers indicate, what code paths within your code are active?