Skip to main content
zaouche
Associate
July 25, 2015
Question

STM32F4 GPIO clock

  • July 25, 2015
  • 3 replies
  • 1055 views
Posted on July 25, 2015 at 03:18

Hello

I have an STM32F429 discovery board

I program it with : STM32-Matlab/target (embedded target for Matlab and Simulink), STM32CubMx (configuration tool) and the toolchain: Keil uVision5 (lite).

I tray a very simple Simulink program, which consist of blinking a LED (PG13, green LED).

For this purpose, I used a ramp generator, from simulink sources, (period 1s, 5% ramle ratio).

The output of the generator is connected to the GPIO_Write block (pin PG13)

The GPIO pin 13 configuration is set as :

GPIO_Mode: OUT

GPIO_Speed : Low

type: pull up

when I download the code in the board, the LED is fired but it doesn't blink

what can I do to resolve this problem ?

thank you for your help

best regards

RCC_AHB1PeriphClockCmd

(

RCC_AHB1Periph_GPIOD

,

ENABLE

)

;

RCC_AHB1PeriphClockCmd

(

RCC_AHB1Periph_GPIOD

,

ENABLE

)

;

#!stm32f4-disco #gpio
This topic has been closed for replies.

3 replies

Tesla DeLorean
Guru
July 25, 2015
Posted on July 25, 2015 at 03:34

Look at the generated source code and step through it with the debugger?

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
zaouche
zaoucheAuthor
Associate
July 25, 2015
Posted on July 25, 2015 at 13:59

Hello clive1

it seems to me, that the GPIO-clock enabling (validation) is not done.

how can I enable the GPIO clock in the STM32CubeMx ?

Tank's for the help

Amel NASRI
Technical Moderator
July 27, 2015
Posted on July 27, 2015 at 17:50

Hi zaouche.khelil,

In order to confirm that issue is because of a missed clock enabling, please add ''__HAL_RCC_GPIOG_CLK_ENABLE();'' to your code.

Let me know if this resolves the issue.

-Mayla-

To give better visibility on the answered topics, please click on "Best Answer" on the reply which solved your issue or answered your question.