AnsweredAssumed Answered

STM32F429-disc1 GPIO_IOToggle test (How can I modify GPIO pin

Question asked by Carter Lee on Sep 5, 2017
Latest reply on Sep 6, 2017 by Carter Lee

Hi.

I've done set up the \STM32F4xx_DSP_StdPeriph_Lib_V1.8.0 with keil and  think the flash download works good.

So I'm trying to implement GPIO_IOToggle test with STM32F4xx_DSP_StdPeriph_Lib_V1.8.0's  template project 

After compile, there is no error and I've uploaded to flash my firmware.

But LED does not work. I think there are some mismatch between STM32F429-disc1 kit and STM32F4xx_DSP_StdPeriph_Lib_V1.8.0's GPIO declaration.

STM32F429-disc1 ki  have just 2 leds  and it's connected PG13 and PG14. but there is no PG13 and PG14.

 

 main code is the following.

the original code is

 

int main(void)
{

 

RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOG, ENABLE);


GPIO_InitStructure.GPIO_Pin = LED1_PIN | LED2_PIN;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(GPIOG, &GPIO_InitStructure);


while (1)
{
/* Set PG6 and PG8 */
GPIOG->BSRRL = LED1_PIN | LED2_PIN;
/* Reset PG6 and PG8 */
GPIOG->BSRRH = LED1_PIN | LED2_PIN;

 

 

 

and I modify such as the below.

 

int main(void)
{

 

RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOG, ENABLE);


GPIO_InitStructure.GPIO_Pin = LED13_PIN | LED14_PIN;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(GPIOG, &GPIO_InitStructure);


while (1)
{

 

GPIOG->BSRRL = LED13_PIN | LED14_PIN;

 

GPIOG->BSRRH = LED13_PIN | LED14_PIN;

}

 

I just want to test of blink in GPIO_IOToggle example project.

Can I use "stm32f4xx_gpio.c" of "STM32F4xx_StdPeriph_Driver" for blink test to PG13 and PG14?

How to connect between PG13, PG14  and "stm32f4xx_gpio.c" of "STM32F4xx_StdPeriph_Driver"?

Would you please help me what am I supposed to do?

 

Outcomes