cancel
Showing results for 
Search instead for 
Did you mean: 

STMF0 Possible to use both USART2 RX and SYS_SWCLK pins simultaneously?

NSharp
Associate II

I would like to be able to use USART2 in RX mode only, but even configuring it as Receive only still takes over the SYS_SWCLK pin (with alternate function USART2 TX). I am never going to use the TX pin, and I'd like to use SYS_SWCLK for flashing and debugging. STM32CoreMX doesn't seem to allow this configuration. Configuring USART2 will setup the pins and options; but, then changing the SYS_SWCLK pin from TX to SWCLK reverts all the USART2 setup.

How can I have my cake and eat it, too? :)

3 REPLIES 3

Stop relying on CubeMX and do it manually. Check there isn't any stupidity in the MSP file setting up the PA14 (SWCLK) pin, you should just be able to set up PA15 and USART2 in RX mode

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

Thank you for your reply - the STM32 architecture and tools are relatively new to me and is what STMicro is pushing for configuration. My previous workaround has been to configure everything as USART2 in CubeMX. Then, go in and remove PA14 from any of the initialization. I guess that's the way forward. Every pin is unique in its alternate function, correct? So, the TX/RX pins are not functionally tied together, unless they are initialized together, right?

The F0 has a pretty flexible pin function mux. The F1 series moved peripheral pins in blocks, and was a headache.

You should be able to configure the RX independent of the TX, whether enabled, or onto an entirely different pin (PA2 or whatever)

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