Hi,
ich versuche mich gerade mit dem Debuggen vertraut zu machen, komme aber
mit der Terminalausgabe nicht zurecht.
Meine Vermutung (Weil ich es auch nicht hin bekomme die ersten
Breakpoints mit Clion anzufahren, nachdem er sich via gdb-remote
verbunden hat) ist, dass das Compilat noch nicht deckungsgleich mit
meinen Sourcen ist.
Hier erstmal meine Bedienung:
1 | ➜ bin git:(feature/Clion_Atmega644) ✗ avr-gdb
|
2 | GNU gdb (GDB) 7.11.1
|
3 | .....
|
4 | Type "apropos word" to search for commands related to "word".
|
5 | 0x00000000 in __vectors ()
|
6 | Loading section .eeprom, size 0xf lma 0x810000
|
7 | Loading section .text, size 0x759e lma 0x0
|
8 | Loading section .data, size 0x62 lma 0x759e
|
9 | Start address 0x0, load size 30223
|
10 | Transfer rate: 2 KB/sec, 47 bytes/write.
|
11 | Haltepunkt 1 at 0x2e8: file /home/dk/CLionProjects/test/main.c, line 28.
|
12 | (gdb) list
|
13 | 14
|
14 | 15 #include "inits.h"
|
15 | 16 #include "controlSystem/buffer.h"
|
16 | 17 #include "controlSystem/closedLoopSystem.h"
|
17 | 18
|
18 | 19 #include "controlSystem/errorHandling.h"
|
19 | 20 #include "input/adc.h"
|
20 | 21 #include "configChange/properties.h"
|
21 | 22 #include "configChange/menueStructure.h"
|
22 | 23 #include "output/displays.h"
|
23 | (gdb) list
|
24 | 24 #include "input/modeDetection.h"
|
25 | 25 #include "input/buttons.h"
|
26 | 26
|
27 | 27 int main() {
|
28 | 28 wdt_reset();//needet before reset on this MCU?
|
29 | 29 wdt_disable();
|
30 | 30 loadEEValues();//eeDisplayDimming for init
|
31 | 31 inits();
|
32 | 32 emergencyStop();//to be sure!
|
33 | 33 initBuffers();
|
34 | (gdb) until inits
|
35 | Anmerkung: Hardware-Haltepunkte für Nur-Lesen-Adressen werden automatisch benutzt.
|
36 | warning: Error removing breakpoint 0
|
37 | warning: Error removing breakpoint 0
|
38 | Remote Verbindung wurde beendet
|
39 | (gdb)
|
Und folgende Compiler-Flags habe ich gesetzt:
1 | add_compile_options(-Wall -Wextra)#all Warnings
|
2 | #add_compile_options(-std=gnu99)
|
3 |
|
4 |
|
5 | SET(COMMON_FLAGS -mmcu=${DEVICE} -DF_CPU=${FREQ}UL -Wl,--gc-sections)
|
6 | if (CMAKE_BUILD_TYPE MATCHES Debug)
|
7 | add_compile_options(-O0 -g ${COMMON_FLAGS}) #(__AVR_ATmega??__)
|
8 | add_link_options(-O0 -g ${COMMON_FLAGS})
|
9 | elseif(CMAKE_BUILD_TYPE MATCHES Release)
|
10 | add_compile_options(-Os ${COMMON_FLAGS})
|
11 | add_link_options(-Os ${COMMON_FLAGS})
|
12 | endif ()
|
Kann man dort aus der Ferne bereits etwas zu sagen?
"avarice -4 -P atmega644 -d :4242"
Grüße David
PS: parallel versuche ich es noch mit einem Simulator (und scheitere)
dachte mir aber mit echter Hardware muss es zuerst funktionieren?!