Skip to main content
KAgga.1
Associate III
June 20, 2023
Question

HAL_UARTEx_ReceiveToIdle_IT fails to initialize

  • June 20, 2023
  • 3 replies
  • 1536 views

Hello There,

I'm using STM32H7A3 and facing a weird issue with HAL_UARTEx_ReceiveToIdle_IT() API.
STM is connected to Cellular Modem via UART. When I turn on the modem via some GPIOs, initially it throws some init data. But when I call HAL_UARTEx_ReceiveToIdle_IT() after modem is turned ON, It fails to do so.
When I tried disconnecting STM32 Uart's Rx line and Modem's Tx line, then initialization was successful.

Any help will be appreciated.

Regards,

Keshav Aggarwal

This topic has been closed for replies.

3 replies

Karl Yamashita
Lead III
June 21, 2023

Without showing code we have no way to help trouble shoot.

If a reply has proven helpful, click on Accept as Solution so that it'll show at top of the post.CAN Jammer an open source CAN bus hacking toolCANableV3 Open Source
GreenGuy
Senior III
June 21, 2023

Your description of the failure is a little vague so with out code to look at we can do little else but guess.  Even with the code I am not sure we can help since it is not clear what "fails to do so" means.  No disrespect intended, but in your mind "fails to do so" is clear to you, but we, on the outside, are lacking context to understand. 

So questions:

Does "fail to do so" mean:

1) the modem init string does not appear:

2) the HAL call returns !success,

3) the interrupt that would respond does not happen?

Last of all when you say "initialization was successful", again we are lacking context.  The modem, the moden init string, or something else?  The HAL call you mentioned is supposed to occur after UART init, and the HAL initialization code for the UART IT handling, and does not really do any init functions other than prime the peripheral to look for idle and receive data up to that point, or receive data up to the count limit.  Also need to know, are you using a circular buffer or normal.

I hope this does come across as being critical; I am just trying to understand the context.

KAgga.1
KAgga.1Author
Associate III
June 22, 2023

Thanks for replying!
I meant HAL_UARTEx_ReceiveToIdle_IT() didn't return HAL_OK after powering on the Modem.
Upon checking the handle, I found huart.ErrorCode was 10. i.e., DMA transfer error
Well, I'm not utilizing DMA with the UART. It might be using internally.

I also found this API returns HAL_OK when I call it before turning ON the Modem.