2019-05-23 02:53 AM
#define RCC_AHB1ENR (*(volatile unsigned long *)0x40023830)
#define GPIOD_MODER (*(volatile unsigned long *)0x40020C00)
#define GPIOD_OTYPER (*(volatile unsigned long *)0x40020C04)
#define GPIOD_OSPEEDR (*(volatile unsigned long *)0x40020C08)
#define GPIOD_PUPDR (*(volatile unsigned long *)0x40020C0C)
#define GPIOD_ODR (*(volatile unsigned long *)0x40020C14)
/* Init Starts here */
main()
{
RCC_AHB1ENR = 0x00000008 ;
GPIOD_MODER = 0x40000000 ;
GPIO_OTYPER = 0x00000000 ;
GPIOD_OSPEEDR = 0x00000000 ;
GPIOD_PUPDR = 0x40000000 ;
/* Init Ends here */
/* LED ON */
GPIO_ODR = 0x10000000 ;
}
Please help me to understand where I am going wrong with the code.
Many Thanks in advance.
2019-06-07 12:13 AM
Thanks a lot . It is working now after adding while(1 ) loop and startup_code.
2019-06-07 12:15 AM
Thanks a lot @turboscrew . It helped a lot.