Skip to main content
zoltan
Associate
August 25, 2014
Question

Set USART2_RTS when GPIO is in alternate function mode.

  • August 25, 2014
  • 2 replies
  • 617 views
Posted on August 25, 2014 at 16:06

I have a STM32L152RCT6 mcu and a bluetooth module connected to usart2. I've also set up the dma for the communication. The gpio is set to alternate function mode. It works, however sometimes a packet loss happens. The manufacturer of the bt modul has suggested that maybe there's a problem with the rts signal and the bt module sends data while i'm processing the previous. So now i would like to test to set the rts manually while i'm processing the incoming packet to prevent the bt module to send anything. However the gpio is set to alternate function mode and i can't set the rts. Is there any way to set the rts pin while it's in af mode?

    This topic has been closed for replies.

    2 replies

    Tesla DeLorean
    Guru
    August 25, 2014
    Posted on August 25, 2014 at 16:20

    Why can't you simply reconfigure the pin?

    Can you change behaviour via RTSE or RXE?
    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    zoltan
    zoltanAuthor
    Associate
    August 26, 2014
    Posted on August 26, 2014 at 10:54

    I have tried and it's working but only when my gpio is in OUT mode. If the gpio is set to af mode, then setting it or the pin or the ODR has no effect on the rts level.