cancel
Showing results for 
Search instead for 
Did you mean: 

How to use PA5 as gpio?

ferhatyol-23
Senior
Posted on January 01, 2018 at 22:31

Hi

I'm using STM32F429I Discovery Board. I need to use the PA5 pin as gpio. But I did not get any output from the PA5 pin.

The PA5 pin appears as an unused pin. 

GPIO_InitTypeDef GPIO_InitStructure;

RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);

/* Configure PA5 Buzzer as output push-pull */

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5;

GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;

GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;

GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;

GPIO_Init(GPIOA, &GPIO_InitStructure);

GPIO_SetBits(GPIOA,GPIO_Pin_5);

These init codes are not working. What is the problem? Is there another feature of this pin?

Thanks

#stm32f4 #pa5-gpio #pa5
3 REPLIES 3
Posted on January 02, 2018 at 01:03

Try not loading the pin, PA5 should work normally. Make sure you are looking at the right pin.

Toggle the pin in a loop, and review with scope.

I don't see any solder bridges being an issue.

Make sure the code in question is actually executed, and inspect RCC and GPIO peripherals in debugger view.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
S.Ma
Principal
Posted on January 02, 2018 at 09:12

After your code has started, Stop the debugger and inspect the GPIO register values to make sure everything look fine.

Sometime, SW bug are obvious mistypings.

ferhatyol-23
Senior
Posted on January 02, 2018 at 14:57

Thank you for the reply. I found the problem via debug. The problem is that this problem is happening when another library I use uses that pin.