Skip to main content
Matt Roybal
Associate III
January 29, 2018
Solved

Can you change SWO output to a different GPIO? I want to use the SPI that conflicts with the SWO, but still need to printf on SWO.

Posted on January 29, 2018 at 21:09

Hello, I am using STM32F103 and STM32F301. I need to use the SPI that shares the same pin as SWO. Is it possible to move the SWO to a different pin so I can retain the printf to console functionality for debugging?

    This topic has been closed for replies.
    Tesla DeLorean
    Tesla DeLoreanBest answer
    Guru
    January 29, 2018
    Posted on January 29, 2018 at 21:29

    Only PB3 supported. Use a USART_TX as an alternative. 

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

    5 replies

    Tesla DeLorean
    Tesla DeLoreanBest answer
    Guru
    January 29, 2018
    Posted on January 29, 2018 at 21:29

    Only PB3 supported. Use a USART_TX as an alternative. 

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Matt Roybal
    Associate III
    January 29, 2018
    Posted on January 29, 2018 at 22:29

    Hi Clive, thanks for the info! So I just need to chose a group of pins, such as RX1/TX1, TX2/TX2, RX3/TX3 and get a UART protocol running on those pairs?

    Andrew Neil
    Super User
    January 30, 2018
    Posted on January 30, 2018 at 10:47

    SWO =

    S

    erial

    W

    ire

    O

    utput - as the name suggests, it is output (Tx) only.

    http://infocenter.arm.com/help/topic/com.arm.doc.ddi0314h/Chdhgebe.html

     

    So there would be no need to reserve an Rx pin for equivalent funcitonality

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    T J
    Senior III
    January 29, 2018
    Posted on January 29, 2018 at 23:58

    In the cube, you can hold <cntl> and click the pin to see alternatives, for the SPI port, I mean...

    T J
    Senior III
    January 30, 2018
    Posted on January 30, 2018 at 07:10

    You use the cube software, to see the available pins for your requirements.

    Did you use the cube before ?

    Edit:

    before the cube there is the reference material;

    PM0214   STM32F3 and STM32F4 Series Cortex®-M4 programming manual.

    Also, in the processor data sheet

    look for PA9  in the alternate function pin map.

    here you can see all the variations of all the pins.