2014-10-28 06:19 AM
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:&sharpinclude <stddef.h>&sharpinclude ''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;} #stm32l152rc-discovery-kit2014-10-28 08:16 AM
Have it toggle the pin in a loop, and step through it in the debugger.
2014-10-28 08:37 AM
I changed the code something like this:
while(1) { int i = 0; i++; GPIO_ToggleBits(GPIOB, GPIO_Pin_7); }It doesn't work with dicovery kit but it works with nucleo kit.