Ich möchte gern ein kleines Projekt mit einem STM32F030 und Atollic
aufsetzen. Ich lege ein neues Projekt an. Es fehlt grundsätzlich die
SPL, die muss man manuell hinzu fügen. Ist aber leichter gesagt als
getan.
Die *.h Dateien kann ich unter Project->Properties->C/C++ General->
Paths and Symbols unter dem Reiter include hinzufügen. Wenn ich jetzt
den simplen Code
1 | /* Includes */
|
2 | #include "stm32f0xx.h"
|
3 | #include "stm32f0xx_conf.h"
|
4 |
|
5 | /* Private macro */
|
6 | /* Private variables */
|
7 | /* Private function prototypes */
|
8 | /* Private functions */
|
9 |
|
10 | /**
|
11 | **===========================================================================
|
12 | **
|
13 | ** Abstract: main program
|
14 | **
|
15 | **===========================================================================
|
16 | */
|
17 | int main(void)
|
18 | {
|
19 | uint32_t i = 0;
|
20 |
|
21 | // Enable Clock
|
22 | RCC_AHBPeriphClockCmd( RCC_AHBPeriph_GPIOA, ENABLE );
|
23 |
|
24 | // Create Initstructure
|
25 | GPIO_InitTypeDef GPIO_InitStructure;
|
26 |
|
27 | // Lets go
|
28 | GPIO_StructInit( &GPIO_InitStructure );
|
29 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3;
|
30 | GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
|
31 | GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
32 | GPIO_InitStructure.GPIO_Speed = GPIO_Speed_Level_3;
|
33 | GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
34 | GPIO_Init(GPIOA, &GPIO_InitStructure);
|
35 |
|
36 | /* TODO - Add your application code here */
|
37 |
|
38 | /* Infinite loop */
|
39 | while (1)
|
40 | {
|
41 | i++;
|
42 | }
|
43 | }
|
haben, kommen folgende Fehlermeldungen:
undefined reference to GPIO_Init
undefined reference to GPIO_StrucInit
undefined reference to RCC_....
logisch, denn die Funktionen kennt er ja noch nicht.
Jetzt scheitert es aber daran, die Funktionen (also Sourcen) dazu
einzubinden. Ich habe es über die "Source Location" versucht, dann haben
diese aber keinen Bezug zu den Headern und ich erhalte unbegrenzt
Fehler.