stm32u585 UART receive not working, transmit working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-03-08 5:15 AM - last edited on ‎2024-04-09 6:54 AM by Amel NASRI
Hi
I have been using stm32u585QII3 MCU in our custom board. I am using USART1(PB6, PG10) to transmit and receive data. In interrupt mode transmit call back is working but receive call back was not working. Initially i have set a break point, the interrupt hits one time in debug mode, then when i try to send data, the interrupt is not hitting. I have tried this in polling method too, and it was not working. I have attached scope images of both transmit and receive. In which the signals is being transmitted but not received by the controller. TRANSMIT
RECEIVE
- Labels:
-
STM32U5 series
-
UART-USART
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-03-08 8:09 AM
> In interrupt mode transmit call back is working but receive call back was not working.
Debug your code, after you think it should have received data, hit pause and examine the state of the uart receive state machine and also the UART registers. Possibly it has errors.
> Initially i have set a break point, the interrupt hits one time in debug mode, then when i try to send data, the interrupt is not hitting.
Where exactly is the breakpoint? When it "hits one time" what is happening in the program and on the bus?
Looks like your TX signal goes to something external and that something external sends a signal back on RX. Correct?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-03-08 11:58 AM
Show some code. Maybe you're not initializing the interrupt again after the first interrupt?
TimerCallback tutorial! | UART and DMA Idle tutorial!
If you find my solution useful, please click the Accept as Solution so others see the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-03-10 10:50 PM - edited ‎2024-03-10 10:53 PM
Hi @TDK
I have paused and examined the UART registers, there are no errors. The debug pointer comes out of the UART function and when i paused it is in the while function.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-03-10 10:51 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-03-13 10:30 PM
@_Danny_ wrote:Hi @TDK
I have paused and examined the UART registers, there are no errors. The debug pointer comes out of the UART function and when i paused it is in the while function.
HAL drivers clear any register error flags. You'll have to check the UART instance as it saves the errors there.
See if this callback is called HAL_UART_ErrorCallback and if so you can check huart->ErrorCode
Looking at your waveform which doesn't look clean, maybe you have a noise error or framing error? Or did you not ground your probe?
TimerCallback tutorial! | UART and DMA Idle tutorial!
If you find my solution useful, please click the Accept as Solution so others see the solution.
