Skip to main content
jprinster
Associate II
July 18, 2017
Question

Using PA15 as an IO on STM32F373, SWJ_CFG?

  • July 18, 2017
  • 1 reply
  • 1018 views
Posted on July 18, 2017 at 17:27

I am using an STM32F373 and debugging with SWD.  I want to use PA15 as an IO pin.  When I go to configure PA15 as an output, the call to GPIO_INIT() causes a reset which disconnects the debugger.  I'm not sure, but I think this is because PA15 is used for JTAG and something is interfering.  

The reference manual says to use PA15 I need to set SWJ_CFG=010.  How do I do this?  I've searched through the manual and can't find any reference to it other than that.  The STM32F103 has an AFIO register for setting it but I can't find something similar.

Is there something else I'm failing to do?

Thanks, Jim

    This topic has been closed for replies.

    1 reply

    Tesla DeLorean
    Guru
    July 18, 2017
    Posted on July 18, 2017 at 18:00

    >>

    I am using an STM32F373 and debugging with SWD.  I want to use PA15 as an IO pin.  When I go to configure PA15 as an output, the call to GPIO_INIT() causes a reset which disconnects the debugger.  I'm not sure, but I think this is because PA15 is used for JTAG and something is interfering.  

    Sorry not familiar with what GPIO_INIT() is doing internally. With a purely SWD connection I don't think PA15 is involved, you should be able to reconfigure the GPIO/AF settings.

    Might also depend on the tool-chain, debugger, etc but no insight into what's being used here.

    Interfering with PA13/14 will cause loss of connectivity, not sure where the reset is coming from.

    Don't have much experience with the F3, other chips had SPL examples using GPIO/JTAG pins.

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    jprinster
    jprinsterAuthor
    Associate II
    July 18, 2017
    Posted on July 18, 2017 at 18:11

    The GPIO_INIT() call configures the pin.  As I step through the code, as soon as the MODER register for PA15 is changed from AF (default=0x02) to Output (0x01) the MCU resets and I loose the debugger.  (I am using IAR EWARM with a J-Link debugger.)  I should be able to reconfigure PA15 since it is used for JTAG but not SWD.