AnsweredAssumed Answered

LED Blinking with STM32F030F4

Question asked by Devipriya Soundararajan on Aug 9, 2017
Latest reply on Aug 17, 2017 by Devipriya Soundararajan

Hi,

I'm using STM32F030F4 MCU for LED blinking function. I used below code with Keil IDE.
But I'm not able to get the output.
Boot0 pin pulled low for internal flash boot loader.
Added Corresponding ST pheripheral library(gpio,misc,rcc file), CMSIS(core_cm3,system_stm32f0xx) and Startup file.
LED connected to Port A_Pin_9. I'm using ST link/v2 for programming. Do I missed anything? or any issue with code?


#include <stm32f0xx.h>
#include <stm32f0xx_gpio.h>
#include <stm32f0xx_rcc.h>
GPIO_InitTypeDef Gp;
#define GreenLED_Pin GPIO_Pin_9
#define LED_GPIO GPIOA
void delay(unsigned int time)
{
for(time=0;time>0;time--);
}
int main(void)
{
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA,ENABLE);
Gp.GPIO_Pin=GreenLED_Pin;
Gp.GPIO_Mode=GPIO_Mode_OUT;
Gp.GPIO_OType=GPIO_OType_OD;
Gp.GPIO_Speed=GPIO_Speed_Level_1;
GPIO_Init(LED_GPIO,&Gp);
while(1)
{
GPIO_SetBits(LED_GPIO,GreenLED_Pin);
delay(10000);
GPIO_ResetBits(LED_GPIO,GreenLED_Pin);
delay(10000);
}
}

Outcomes