cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4xx - UART - HAL - Hardware flow control.

pradeepsysargus
Associate II
Posted on February 05, 2017 at 15:40

Does CTS/RTS signals get asserted or de-asserted between transmitter and receiver by just enabling hardware flow control for UART in stm32cube software ?

Do I need to check the statuses of CTS/RTS signals for using HAL functions like HAL_UART_Transmit() or HAL_UART_Receive() or HAL_UART_Receive_IT(). ? or Do I need to assert or de-assert those signals for communication to happen ?

#hal #stm32-uart-hardware-flow-rts/cts #stm32f4
8 REPLIES 8
Vitor Pereira
Associate II
Posted on February 27, 2017 at 19:22

Hi, I'm trying to use it as well, and obsrving what is going on with a logic analyzer, and I can see the RTS line getting low when I want to transmit something. I guess the answer is that the configuration you make on CubeMX is enough for the flow control happen during the communcation.

I'm having another problem, though: I programmed my board to turn on the LEDs if the trasmissions is sucsessful, and it turns them on, but I can't see anything in te logic analyzer.

Were you able to find your answer since you posted this message? If you did, please let me know

Vítor Pereira

Posted on February 28, 2017 at 05:31

Hello Vitor,

After enabling Hardware flow control, I was able to transmit and receive data between STM32F4 MCU and a bluetooth module which also has Hardware flow control enabled. The communication was fine. I guess no need to assert or de-assert the CTS/RTS signals or check the status of the signals.

Good luck.

Thanks,

Posted on February 28, 2017 at 19:18

Nice that you did it! I'm also working with a bluetooth module.

Thanks for the reply. 

Vítor Pereira

Posted on March 03, 2017 at 21:39

Hi,

Indeed, once the Hardware flow control is enabled, you don't need to monitor the CTS status or to set the RTS signal.

You can can call

HAL_UART_Transmit() or HAL_UART_Receive() or HAL_UART_Receive_IT()

 directly.

Regards,

Réjane

Posted on January 17, 2018 at 16:32

Hello,

I confirm that with CTS and RTS wired with the other board, the communication works well.

I tried to use bad wiring ( short-circuit the RTS and CTS lines), and the communication still work well,

More over, if i wire only the CTS of the STM32 to the RTS of my board, the communication still work well.

I used various data size, 1 byte and more.

I want to know if this behaviour is normal.

I'm using STM32L486xx Device.

Without wiring the CTS and RTS, it doesn't work  as expected.

Thanks.

Posted on January 17, 2018 at 16:52

>>I want to know if this behaviour is normal.

Doesn't seem unreasonable, one of the pins is an input, the other is an output. ie you can report your own state, and choose to use or ignore the remote's state

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on January 23, 2018 at 16:20

Hi CLive,

Do you have any explanation about why when i short-circuit the CTS-RTS lines between 2 boards, the communications still works fine?

In my case, i am using UART polling mode, half duplex communication, and my USART pins are configured pullup'tried with pulldown also'.

 
Posted on January 23, 2018 at 16:59

looping back the flow-control lines pretty much signals 'ready for data' all the time, neither side will wait, equivalent to not having flow control.

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