UART intrrupt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-04-10 11:35 PM
Check for other ISR bits or error status being flagged.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-04-11 1:40 AM
I have Disable All Error flags intrrupt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-04-11 1: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-04-11 1: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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-04-11 3: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-04-11 3:55 AM
this STM32l071
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-04-11 5: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-04-11 5:48 AM
I have not Enabled any ERROR INTERRUPT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-04-11 6: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?
Up vote any posts that you find helpful, it shows what's working..
