cancel
Showing results for 
Search instead for 
Did you mean: 

Debugger not turning on LED

Fixer
Associate II
 
2 REPLIES 2

Not sure what you system is doing, I might mask on values

    #include <stdint.h>
     
    int main(void)
    {
    	//enable clock for GPIO C
    	uint32_t* RCC_APB2ENR = (uint32_t*)0x40021018;  //APB2 peripheral clock enable register
    	*RCC_APB2ENR |= 1<<4;  //bit number 4 enables clock for gpio C
     
    	uint32_t* GPIOC_CRH  = (uint32_t *)0x40011004; //Port C configuration register high
    	*GPIOC_CRH = (*GPIOC_CRH & ~(0xF << 20)) | 
         0<<23 | 0<<22 | 1<<21 | 1<<20;  //Set Port C I/O 13 to output push pull @ 2Mhz
     
        uint32_t* GPIOC_ODR = (uint32_t*)0x4001100C; //Port C output data register
     
    	while(1)
    	{
    		*GPIOC_ODR |= 1<<13;  //Set bit 13
    	}
    }

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

I figured it out. It was user error. Nothing to do with the debugger.