AnsweredAssumed Answered

STM32L Discovery Blue/Green Led not working

Question asked by lawatsch.michael on Mar 19, 2013
Latest reply on Mar 19, 2013 by fm
Hi,
I managed to compile and start the Temperature Measurement Example with Eclipse and Code Sorcery. It runs and shows a temperature.

I wanted to add a few lines of code to see the LEDs blinking inside the infinite while loop of the example. 
So I started to GPIO_Set the Bits with  GPIO_SetBits(GPIOB, GPIO_Pin_6|GPIO_Pin_7);
Seems to be strait forward, but nothing happens. The Pins stay Low all time (measured).

The main.c is containing a Init_GPIOs.
With this Lines:
    GPIO_InitStructure.GPIO_Pin = LD_GREEN_GPIO_PIN | LD_BLUE_GPIO_PIN;
    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
    GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
    GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_10MHz;
    GPIO_Init(GPIOB, &GPIO_InitStructure);

I only used sources from STM32L_Discovery_Firmware_Pack_V1.0.2.

I see that the SetBits call ends up in GPIOx->BSRRL = GPIO_Pin;

I also toggled the Bits using also the ResetBis function, with no success.
Maybe the registers are not mapped correctly.
Where is the translation to an address for GPIOx->BSRRL = GPIO_Pin; ?
Had someone else a Problem with Leds in the Temperature example?
Have anybody experience using Eclipse/Code Sorcery/OpenOCD?

Thanks.
Michael


Outcomes