cancel
Showing results for 
Search instead for 
Did you mean: 

How to set Serial Handflow values in STM32L475VG

sagar verma
Associate II

Hi All

We have a custom board based on STM32L475VG. Can anyone please assist that how to set the _serial_handflow values for the usart2 of this chipset.

Reference link for serial handflow -->> https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/content/ntddser/ns-ntddser-_serial_handflow

 An excerpt from the above page is as follows-

SERIAL_HANDFLOW structure
04/23/2018
2 minutes to read
The SERIAL_HANDFLOW structure specifies the handshake and flow control settings for a serial port.
 
Syntax
 
typedef struct _SERIAL_HANDFLOW {
  ULONG ControlHandShake;
  ULONG FlowReplace;
  LONG  XonLimit;
  LONG  XoffLimit;
} SERIAL_HANDFLOW, *PSERIAL_HANDFLOW;

I have tried looking into HAL documentation and also the STM32 cubemx software , but to no avail.

Regards

Sagar Verma

3 REPLIES 3
sagar verma
Associate II

Can anyone assist on this ?

>>Can anyone assist on this ?

Not really, Microsoft NT stuff isn't super relevant here.

Flow control.

The Xon/Xoff is software flow control, you'd need to implement it yourself. You're looking for specific characters to manage your buffers and how you push data onto the USART peripheral.

Hardware flow control via CTS/RTS is selected via the HwFlowCtl setting.

 UartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE;

/** @defgroup UART_Hardware_Flow_Control UART Hardware Flow Control

 * @{

 */

#define UART_HWCONTROL_NONE                 0x00000000U                         /*!< No hardware control      */

#define UART_HWCONTROL_RTS                  USART_CR3_RTSE                      /*!< Request To Send          */

#define UART_HWCONTROL_CTS                  USART_CR3_CTSE                      /*!< Clear To Send            */

#define UART_HWCONTROL_RTS_CTS              (USART_CR3_RTSE | USART_CR3_CTSE)   /*!< Request and Clear To Send */

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
sagar verma
Associate II

Thank you Clive.

I am using the same setting in the init handle so the software flow control should be on.

But still I am unable to connect to the SBD modem.