Skip to main content
Fixer
Associate II
October 22, 2019
Question

Debugger not turning on LED

  • October 22, 2019
  • 1 reply
  • 809 views

..

This topic has been closed for replies.

1 reply

Tesla DeLorean
Guru
October 23, 2019

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 VenmoUp vote any posts that you find helpful, it shows what's working..
Fixer
FixerAuthor
Associate II
October 23, 2019

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