This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Blink Newbie help debug!

Hi Forum.

I'm new to ARM, but have experience with AVR. I'm just trying to make a Hello World with blinky LEDs. I have this board:

https://forum.micropython.org/viewtopic.php?t=3086

So ok, everything seems to be setup right. I can compile and also program the Flash, it verify's with no errors. There are two onboard LEDs connected to A6 and A7 (it says so in the link, but I have also double checked). I can't get them to blink or flash. 

This is my code:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "stm32f407xx.h"
void myDelay(int times){
volatile int i, j;
for (i = 0; i < times; ++i) {
j++;
}
}
void ini(void){
RCC -> AHB1ENR |= RCC_AHB1ENR_GPIOAEN; //enable GPIO clock for AHB og RCC
GPIOA -> MODER |= GPIO_MODER_MODER6_0 |GPIO_MODER_MODER7_0;
GPIOA -> OTYPER &= ~(GPIO_OTYPER_OT_7|GPIO_OTYPER_OT_6);
GPIOA -> OSPEEDR |= GPIO_OSPEEDER_OSPEEDR7_1 | GPIO_OSPEEDER_OSPEEDR6_1; //High speed 10
GPIOA -> PUPDR &= ~(GPIO_PUPDR_PUPDR7 | GPIO_PUPDR_PUPDR6);
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I hope someone can help me se what I'm doing wrong?

Best Regards

Ole.

0