Skip to main content
Associate II
November 14, 2023
Solved

stm32c0x use debug pins as gpio input pins

  • November 14, 2023
  • 3 replies
  • 2203 views

Hi, may i know how do i declare the debug pins (PA13, PA14) as input pins after programming?

This topic has been closed for replies.
Best answer by Aime

Hi @Hollis_K ,

 

The pins PA13 and PA14 can be remapped as input in your application, the same way as for any other GPIOs.

 

Best regards,

Aime

3 replies

AimeBest answer
ST Employee
November 14, 2023

Hi @Hollis_K ,

 

The pins PA13 and PA14 can be remapped as input in your application, the same way as for any other GPIOs.

 

Best regards,

Aime

Hollis_KAuthor
Associate II
November 15, 2023

Hi @Aime ,

thanks for the information. After debugged the program, necessary to reset gpio pin if using the debug pins as input pins? There are some reference i find if using debug pins as the gpio output pins: 

...

LL_GPIO_SetOutputPin(GPIOA, LL_GPIO_PIN_14);
LL_mDelay(1);
LL_GPIO_ResetOutputPin(GPIOA, LL_GPIO_PIN_14);
LL_mDelay(500);
LL_GPIO_ResetOutputPin(GPIOA, LL_GPIO_PIN_13);
LL_mDelay(1);
LL_GPIO_SetOutputPin(GPIOA, LL_GPIO_PIN_13);

...

 

if use as gpio input, will it be the same? Curious about that.

ONadr.1
Senior III
November 14, 2023

If you need to debug and at the same time use these pins for IO operations, it is possible to use the same MCU in a case with more pins and use other GPIOs instead of PA13,14. After debugging the program, change back to PA13,14 and write the debugged program into a small case. It is almost necessary for 8-pin cases.