I'm writing a simple program to use one of the GPIO pins to toggle an LED. I'm not using the Circle OS target, but wrote the code to target the device, STM32F103VET6 directly. What I have so far does not toggle my LED. Can someone else? I'm using Port C, pin 6, which should go to one of the LEDS. I am not using BSRR, but ODR.
#define GPIOC_CRL (*(u32*)0x40011000) //PORT C address
#define GPIOC_CRH (*(u32*)0x40011804)
#define GPIOC_ODR (*(u32*)0x4001180C) //Address of output
int main( void )
{
GPIOC_CRL = 0x2222; //set all to outputMode @2MHz, General Purpose push-pull
GPIOC_ODR = 0x0000; //Clear all GPIOC pin
for(;
{
GPIOC_ODR=0x40; //turn on pin6 to toggle LED
}
return 0;
}