Skip to main content
Visitor II
May 2, 2024
Solved

STM32L475 and URC's management via UART

  • May 2, 2024
  • 3 replies
  • 1407 views

Hello,

I'm managing a Wifi modem using one of the USARTs of the STM32L475.

Modem is working fine when sending and receiving AT commands and data, but I'm not able to receive URC's.

I only receive URC's when they come 'together' (very close) to the answer of a AT command.

But if do not receive any URC when micro is not asking nothing: in this case, micro has RX IRQ activated (HAL_UART_Receive_IT(...)), and micro enters into the HAL_UART_RxCpltCallback when receiving data, but no URC is received --> The only character received at this time is either 0x0A or 0x0D.

Any suggestion in managing URCs?

Regards

    This topic has been closed for replies.
    Best answer by dtarrago

    Already solved: it was a problem related to UART characters reception treatment in my interrupt rutine.

    Regards.

    3 replies

    Super User
    May 2, 2024

    "URCs" as in "Unsolicited Result Codes" ?

     


    @dtarrago wrote:

    I only receive URC's when they come 'together' (very close) to the answer of a AT command.


    Does your STM32 "sleep" - so that it's not ready for anything coming in ?

     

    Addendum:

     


    @dtarrago wrote:

    The only character received at this time is either 0x0A or 0x0D.


    A URC will begin with a CRLF lead-in - is your code seeing that as the end of a message, instead of waiting for the rest of the URC ... ?

    :thinking_face:

     

    Graduate II
    May 2, 2024

    Receive data into a FIFO / Ring Buffer, and process periodically?

    dtarragoAuthorAnswer
    Visitor II
    May 10, 2024

    Already solved: it was a problem related to UART characters reception treatment in my interrupt rutine.

    Regards.

    Super User
    May 10, 2024

    That's good - so please mark this as solved.

    It would be helpful for future readers if you could describe what was wrong, and how you found it ...