Hallo, wie der Titel schon sagt, versuche ich eine LED zum Blinken zu bringen. Leider blinkt da gar nichts. Compiler/Linker/Flashen sieht gut aus, aber trotzdem blinkt nichts. LED hängt an PB11 über 1k an GND.
1 | #include "stm32f10x.h" |
2 | #include "stm32f10x_gpio.h" |
3 | #include "stm32f10x_rcc.h" |
4 | |
5 | int main(void) { |
6 | int i; |
7 | |
8 | /* Initialize Leds mounted on STM32 board */
|
9 | GPIO_InitTypeDef GPIO_InitStructure; |
10 | |
11 | /* Initialize LED which connected to PB11, Enable the Clock*/
|
12 | RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE); |
13 | |
14 | /* Configure the GPIO_LED pin */
|
15 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All; |
16 | GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; |
17 | GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; |
18 | GPIO_Init(GPIOB, &GPIO_InitStructure); |
19 | |
20 | while (1) { |
21 | |
22 | GPIO_WriteBit(GPIOB, GPIO_Pin_11, Bit_SET); |
23 | for (i = 0; i < 1000000; i++) |
24 | ;
|
25 | GPIO_WriteBit(GPIOB, GPIO_Pin_11, Bit_RESET); |
26 | for (i = 0; i < 1000000; i++) |
27 | ;
|
28 | |
29 | }
|
30 | }
|
Ich verwende die Coocox 1.7.0 IDE mit GCC 4.7 Toolchain (-O0). Fehlt noch etwas an Initialisierung? 5x Stromversorgung und Abblockkondensatoren sind vorhanden. MC ist ein STM32F107RC. Es ist ein Quarz mit 25Mhz un 2x22pf angeschlossen. Flasher ist der ST-Link vom STM32F4-Discovery.