cancel
Showing results for 
Search instead for 
Did you mean: 

Disable the debug

dhva1234
Associate II

Hello,

i am working with the STM32F401RE board along with the IHM02A1 expansion board. I am using the X-CUBE-SPN2 package.

I am working with a predefined project from X-CUBE-SPN2 and modifying it according to my requirements. I am defining all the GPIO pins, using some as input and some as output.

However, I am facing a problem with GPIO pins PA13 and PA14. These pins are used for the debugger by default. I do not want to use the debugger and instead want to use these pins as input/output.

I want to know how to disable the debug function for these pins and directly flash the program to the board. I have also tried using the “green icon” menu to flash, but it is not working.

This is quite urgent. I would really appreciate your guidance on how to resolve this issue.

Thank you so much in advance.

1 ACCEPTED SOLUTION

Accepted Solutions

PA14 is configured the same way as other pins. Recheck your assumptions. Set it as GPIO output and verify that IDR changes when ODR changes. Will be tougher to do without a debugger, but perhaps you can use a UART stream or LED.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

3 REPLIES 3
TDK
Super User

In your program, configure PA13 and PA14 how you want. They will lose debug functionality and this will make it more difficult to flash your program. CubeMX can do this for you if you choose the function you want for these pins.

If you feel a post has answered your question, please click "Accept as Solution".

Hi TDK,

Thanks a lot for your explanation. In my case, I’m working with the X-CUBE-SPN2 package, so it’s a bare-metal C project without a .ioc file or CubeMX configuration. I configured PA13 as input, and that works fine.

However, with PA14, I set it as an output in my code, but it always stays at logic high by default. Even if I configure it as reset mode, it still remains high when I measure it.

Is this expected behavior because PA14 is SWCLK for the debugger? If so, is there a way to fully release this pin for normal GPIO use when not debugging?

Thanks again for your guidance!

PA14 is configured the same way as other pins. Recheck your assumptions. Set it as GPIO output and verify that IDR changes when ODR changes. Will be tougher to do without a debugger, but perhaps you can use a UART stream or LED.

If you feel a post has answered your question, please click "Accept as Solution".