2013-03-18 06:13 PM
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 #bit-banding-stm32l #gpio #led2013-03-19 12:38 AM
Have you turned on the clock for the GPIOB ?
If not, all your initialization and access attempts are futile. I suggest to take an example, GPIOToggle for instance, from the peripheral libs, and dissect it. It will show you all the steps necessary to use GPIO pins.