Skip to main content
dtarrago
Associate III
May 2, 2024
Solved

STM32L475 and URC's management via UART

  • May 2, 2024
  • 4 replies
  • 1440 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.

4 replies

Andrew Neil
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:

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Tesla DeLorean
Guru
May 2, 2024

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

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
dtarrago
dtarragoAuthorBest answer
Associate III
May 10, 2024

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

Regards.

Andrew Neil
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 ...

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.