Skip to main content
Fixer
Associate II
Oct 22, 2019 10:56 PM UTC
Question

Debugger not turning on LED

..

This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
Oct 23, 2019 12:46 AM UTC

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
Fixer
FixerAuthor
Associate II
Oct 23, 2019 2:49 AM UTC

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