cancel
Showing results for 
Search instead for 
Did you mean: 

stm32c0x use debug pins as gpio input pins

Hollis_K
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions
Aime
ST Employee

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

View solution in original post

3 REPLIES 3
Aime
ST Employee

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

ONadr.1
Senior III

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.

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.