cancel
Showing results for 
Search instead for 
Did you mean: 

Using PA15 as an IO on STM32F373, SWJ_CFG?

jprinster
Associate II
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

2 REPLIES 2
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 Venmo Up vote any posts that you find helpful, it shows what's working..
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.