Usart flow control (rts/cts) in stm32f1xx
Moderators: RoccoMarco, lbednarz, tfAteba
Usart flow control (rts/cts) in stm32f1xx
Hello, i Was wondering if rts/cts flow control is supported by chibios for stm32f1xx ucontrollers.
If yes, were could i find a code snippet of such configuration, showing also how to receive and transmit?
I tried using cr1, cr2 and cr3 in uartconfig structure while configuring; but I Saw no rts/cts handling by uc,
Expecially in receiving stage.
Thanks
-g
If yes, were could i find a code snippet of such configuration, showing also how to receive and transmit?
I tried using cr1, cr2 and cr3 in uartconfig structure while configuring; but I Saw no rts/cts handling by uc,
Expecially in receiving stage.
Thanks
-g
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Usart flow control (rts/cts) in stm32f1xx
Hi,
HW flow control is not explicitly implemented in the driver but is should be pretty much automatic when enabled in control registers, at least this is what I read in the reference manual in section 27.3.14. Make sure that CTS/RTS pins are configured correctly, outputs should be alternate functions on the F1.
Giovanni
HW flow control is not explicitly implemented in the driver but is should be pretty much automatic when enabled in control registers, at least this is what I read in the reference manual in section 27.3.14. Make sure that CTS/RTS pins are configured correctly, outputs should be alternate functions on the F1.
Giovanni
Re: Usart flow control (rts/cts) in stm32f1xx
Hi Giovanni, I have done what you wrote, which is the same I did before, and receiver does not work.
The reason is RTS stays always UP, and never gets down.
So I am wondering, do I have to explicitly call the uartStartReceive function after each send?
Bye
-g
The reason is RTS stays always UP, and never gets down.
So I am wondering, do I have to explicitly call the uartStartReceive function after each send?
Bye
-g
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Usart flow control (rts/cts) in stm32f1xx
Hi,
Is RTS programmed as alternate output?
A question, are you sure you need the "UART" driver? it is possible the "Serial" driver is better in your case, what are your requirements? note that the UART driver is unbuffered (the Serial driver is buffered instead) and you have to restart the transfers after each callback.
Giovanni
Is RTS programmed as alternate output?
A question, are you sure you need the "UART" driver? it is possible the "Serial" driver is better in your case, what are your requirements? note that the UART driver is unbuffered (the Serial driver is buffered instead) and you have to restart the transfers after each callback.
Giovanni
Re: Usart flow control (rts/cts) in stm32f1xx
Hi Giovanni, RTS is alternate output.
But I just read the errata sheet of my stm32f103 (http://www.st.com/internet/com/TECHNICA ... 197763.pdf) and seems that in my case
there is a conflict with CAN:
" the CAN must be remapped to either another IO configuration when the CAN is used, or to the unused configuration (CAN_REMAP[1:0] set to “01â€) when the CAN is not used."
How do I remap can to unused configuration?
I am using usart to interface with a gprs modem: is using the uart device the right thing to do?
Another question: does serial peripherals support cts/rts flow control?
Thanks.
-g
But I just read the errata sheet of my stm32f103 (http://www.st.com/internet/com/TECHNICA ... 197763.pdf) and seems that in my case
there is a conflict with CAN:
" the CAN must be remapped to either another IO configuration when the CAN is used, or to the unused configuration (CAN_REMAP[1:0] set to “01â€) when the CAN is not used."
How do I remap can to unused configuration?
I am using usart to interface with a gprs modem: is using the uart device the right thing to do?
Another question: does serial peripherals support cts/rts flow control?
Thanks.
-g
Re: Usart flow control (rts/cts) in stm32f1xx
Hello all, I did it.
It depended on the errata sheet I reported in my previous post.
Definitely, now, it seems to works fine.
Just a few seconds for last question: which driver should I use to talk to a gprs modem? usart or serial?
Thanks for your time and consideration.
bye
-g
It depended on the errata sheet I reported in my previous post.
Definitely, now, it seems to works fine.
Just a few seconds for last question: which driver should I use to talk to a gprs modem? usart or serial?
Thanks for your time and consideration.
bye
-g
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Usart flow control (rts/cts) in stm32f1xx
Hi,
Both can be used but Serial is probably easier to use, it does not require callbacks and supports communication timeouts natively, the UART driver is mostly meant for packet-oriented applications at very high rates.
Giovanni
Both can be used but Serial is probably easier to use, it does not require callbacks and supports communication timeouts natively, the UART driver is mostly meant for packet-oriented applications at very high rates.
Giovanni
Re: Usart flow control (rts/cts) in stm32f1xx
So uart driver has to be used for implementing lwip over ppp: is'nt it?
P
P
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Usart flow control (rts/cts) in stm32f1xx
It can be used in any application but Serial is easier most of times.
Could be used for ppp or for an RS485 network for example, anywhere data is organized in packets rather than streams.
Giovanni
Could be used for ppp or for an RS485 network for example, anywhere data is organized in packets rather than streams.
Giovanni
Re: Usart flow control (rts/cts) in stm32f1xx
Looks good... What about udp streams? Would you use serial or uart driver? In this case, we have streams of datas,
inside udp packets...
-g
inside udp packets...
-g