Moin Leute,
Ich hab da gerade ein kleines Problem mit meiner Testumgebung fuer einen CH32V003.
Mein System ist im Prinzip ein Eigenbau der zu 90% hierauf basiert:
https://github.com/cnlohr/ch32v003fun
Ich hab z.b ein kleines Testprogramm das eine LED an einem Pin blinken laesst und es funktioniert.
Ich linke nun ein weiteres Testprogramm hinzu OHNE das ich daraus irgendwas benutzte! Sofort haengt sich mein Testprogramm weg.
Grund dafuer ist folgendes:
1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
Alleine die deklaration dieses Systick_Handler sorgt dafuer das mein Programm nicht laeuft. Der Grund wird auch klar wenn man ins mapfile schaut:
Ohne Systick:
1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
Und so mit Systick:
1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
Der Linker fummelt mir also wohl die Interrupttabelle kaputt.
So sieht die uebersetztung aus:
make riscv-none-embed-gcc --specs=nosys.specs -g -Os -flto -ffunction-sections -static-libgcc -march=rv32ec -mabi=ilp32e -nostdlib -I./riscv_core/extralibs -I./riscv_core -I./riscv_core/inc -I./riscv_core/attic -T ./riscv_core/inc/ch32v003fun.ld -Wl,-Map=mapfile.txt -lc -lm -Wl,--gc-sections -L./riscv_core/misc -lgcc riscv_core/attic/startup_ch32v003.c timer.c main.c -o template.elf riscv-none-embed-objcopy -O ihex template.elf template.hex riscv-none-embed-objcopy -O binary template.elf template.bin
Ich vermute mal das ich da noch irgendeine Option vergessen habe? Oder woran kann das sonst liegen?
Der Handler selbst wird im StartUp-Code weak definiert:
1 |
|
Vanye