2018-08-22 10:35 PM
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
2018-08-26 05:41 PM
Can anyone assist on this ?
2018-08-26 05:52 PM
>>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 */
2018-08-26 10:22 PM
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.