AnsweredAssumed Answered

driving LD3 in STM32L1 discovery kit

Question asked by nandagoban.arulnambi on Oct 28, 2014
Latest reply on Oct 28, 2014 by nandagoban.arulnambi
Hello,

I am new to STM32 development. I am trying to get familiar with discovery kit.
I am using Atollic true studio lite version. I am trying to drive LD3 but it seems not working. Here is my code:

#include <stddef.h>
#include "stm32l1xx.h"


static volatile uint32_t TimingDelay;


static void GPIO_LED_GREEN_SETUP(void)
{
     GPIO_InitTypeDef GPIO_InitStructure;


     RCC_DeInit();
//     GPIO_DeInit(GPIOB);


     RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOB,ENABLE);
     GPIO_StructInit(&GPIO_InitStructure);


     GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7;
     GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
     GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;


     GPIO_Init(GPIOB, &GPIO_InitStructure);


}


int main(void)
{




     GPIO_LED_GREEN_SETUP();
     GPIO_SetBits(GPIOB,GPIO_Pin_7);     /* LED on/off */
     while(1);
//     }


     return 0;
}



Outcomes