2020-11-11 10:53 AM
Hello all i am trying to implement a simple thing that is trying to blink LED using a function. Below attached are main.c, project.c and project.h. If i try the same thing without using a function it works fine but if i use the function it doesnot blink.
2020-11-11 12:18 PM
Hello @NSirm.1 ,
You should check your GPIO configuration. Did you start the GPIO Clock ?
I recommend you to follow step by step tutorial that can help you to blink a led on your board.
You can also review the example within STM32CubeF2: STM32Cube_FW_F2_V1.9.2\Projects\NUCLEO-F207ZG\Examples\GPIO\GPIO_IOToggle. This sample code shows how to initialize and use GPIO HAL API to toggle LED1, LED2, LED3 and LED4 IOs.
STM32CubeF2/Projects/NUCLEO-F207ZG/Examples/GPIO/GPIO_IOToggle/Src/main.c
I hope that this brings some help.
Imen
2020-11-11 12:37 PM
Posting code snippets using the </> button, rather than screen shots
Don't break out the while() loop, no need for void there, consider toggling the LED so you can actually scope the pin. Add a delay so it would be visible to the eye.