2017-07-18 08:27 AM
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
2017-07-18 09:00 AM
>>
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.
2017-07-18 11:11 AM
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.