Skip to main content
Visitor II
May 3, 2024
Solved

UART RTS/CTS not working

  • May 3, 2024
  • 2 replies
  • 2968 views

Dear Sir.

I am trying to test for rts/cts , I use a program that transmit a 16 byte data

every 1 ms .

Tying rts or cts to gnd or 3.3v  makes no impact on the TX output.

How do I insure that the code  works with RTS\CTS ?

 

Pleas advise

 

    This topic has been closed for replies.
    Best answer by Danish1

    That looks credible to me. (Disclaimer: I don't use HAL).

    So my next thoughts are that it could be one of:

    • A bug in HAL and (e.g.) ST didn't correctly code that UART4 supports hardware handshaking. So it ignored your request of UART_HWCONTROL_RTS_CTS. Can you check that U(S)ART4->CR3 has the appropriate bit(s) set after HAL_UART_Init(). (If in doubt check the Reference Manual).
    • A problem with your test board, perhaps GPIOB7 isn't soldered or doesn't go to where you expect on your test board. Can you program that pin to be output and see that it goes high / low when you want. Also program it to be input and verify that you can read the logic level.
    • A problem with the stm32U575, and CTS isn't correctly routed to GPIOB7. I don't see mention of it in the errata, but if the chip is sufficiently new then maybe you're the first to hit this problem. Can you read the (inverted) state of CTS in U(S)ART4->ISR?

    2 replies

    Graduate
    May 3, 2024

    Hep us to help you. Show us what you've done so far:

    • What board you're using, which pins you expect for TXD, RXD, CTS, RTS
    • Your source code, including how you enable the handshaking.

    With that, we might be able to give you pointers as to what you might have done wrong.

    Visitor II
    May 3, 2024

    Hi

    Thanks for the speedy answer .

     

    I use  stm32u575 , uart 4, PA0 TX, PA1 RX , PA15 RTS , PB7 CTS

     

    See attached project

     

    Thanks

    Graduate
    May 7, 2024

    Please post the source code in text form in a reply.

    And images of schematics where appropriate.

    An entire project is way too big for us to wade through and might contain malware so many people won't bother to look.

     

    Danish1Answer
    Graduate
    May 7, 2024

    That looks credible to me. (Disclaimer: I don't use HAL).

    So my next thoughts are that it could be one of:

    • A bug in HAL and (e.g.) ST didn't correctly code that UART4 supports hardware handshaking. So it ignored your request of UART_HWCONTROL_RTS_CTS. Can you check that U(S)ART4->CR3 has the appropriate bit(s) set after HAL_UART_Init(). (If in doubt check the Reference Manual).
    • A problem with your test board, perhaps GPIOB7 isn't soldered or doesn't go to where you expect on your test board. Can you program that pin to be output and see that it goes high / low when you want. Also program it to be input and verify that you can read the logic level.
    • A problem with the stm32U575, and CTS isn't correctly routed to GPIOB7. I don't see mention of it in the errata, but if the chip is sufficiently new then maybe you're the first to hit this problem. Can you read the (inverted) state of CTS in U(S)ART4->ISR?