GDB Client:
(gdb) tbreak Reset_Handler
Temporary breakpoint 1 at 0x202102f4: file C:\Eclipse_MCU_And_Toolchains\RTOS_BSP\platform\devices\MCIMX7D\startup\gcc\startup_MCIMX7D_M4.S, line 207.
(gdb) continue
Continuing.
Temporary breakpoint 1, Reset_Handler ()
at C:\Eclipse_MCU_And_Toolchains\RTOS_BSP\platform\devices\MCIMX7D\startup\gcc\startup_MCIMX7D_M4.S:207
207 cpsid i /* Mask interrupts */
(gdb)
GDB Server:
Starting target CPU...
...Breakpoint reached @ address 0x202102F4
Reading all registers
Removing breakpoint @ address 0x202102F4, Size = 2
Read 4 bytes @ address 0x202102F4 (Data = 0xF001B672)
Read 2 bytes @ address 0x202102F4 (Data = 0xB672)
Well that looks pretty decent!
I used the step command in the GDB client, first step looked good, second kinda failed.
(gdb) step
209 bl SystemInit
(gdb) step
Program received signal SIGTRAP, Trace/breakpoint trap.
0x00492f84 in ?? ()
So I tried a reset and setting the breakpoint in the reset handler again:
(gdb) monitor reset
Resetting target
(gdb) tbreak Reset_Handler
Temporary breakpoint 2 at 0x202102f4: file C:\Eclipse_MCU_And_Toolchains\RTOS_BSP\platform\devices\MCIMX7D\startup\gcc\startup_MCIMX7D_M4.S, line 207.
(gdb) continue
Continuing.
Program received signal SIGTRAP, Trace/breakpoint trap.
0x00492f84 in ?? ()
(gdb) tbreak main
Ignoring packet error, continuing...
The target is not responding to GDB commands.
So I think its not ideal yet, but rather close to what is needed.
You have been an awesome help so far, thanks a lot!
- - - - EDIT - - - - -
Program received signal SIGTRAP, Trace/breakpoint trap.
0x00490f84 in ?? ()
--> Always lands here, no matter if breakpoints have been set or not. Wonder if the program counter might accidently point to some forbidden location?
The datasheet names a "reserved" area from 0040 000 to 004F FFFF. Whatever this "reserved" tells me. None of the data during load is put in this location (0x2021.. is OCRAM_128KB), so i wonder why the program counter even gets there. The .elf file is ~254 KB in size, but "load size" is 14796 (what is exactly the size of the gerated .bin file). So this should fit into OCRAM?
Loading section .interrupts, size 0x240 lma 0x20210000
Loading section .text, size 0x370c lma 0x20210240
Loading section .ARM, size 0x8 lma 0x2021394c
Loading section .init_array, size 0x4 lma 0x20213954
Loading section .fini_array, size 0x4 lma 0x20213958
Loading section .data, size 0x70 lma 0x2021395c
Start address 0x202102f4, load size 14796
- - - - EDIT 2 - - - - -
Using the Hello World DDR example instead of the OCRAM example, i get the folowing (even after deleting all breakpoints).
Starting target CPU...
...Target halted (DBGRQ, PC = 0x20212138)
Reading all registers
Read 4 bytes @ address 0x20212138 (Data = 0xAF00B480)
Starting target CPU...
...Target halted (DBGRQ, PC = 0x20212138)
Reading all registers
Read 4 bytes @ address 0x20212138 (Data = 0xAF00B480)
Starting target CPU...
...Target halted (DBGRQ, PC = 0x20212138)
Reading all registers
Read 4 bytes @ address 0x20212138 (Data = 0xAF00B480)
Starting target CPU...
...Target halted (DBGRQ, PC = 0x20212138)
Reading all registers
Read 4 bytes @ address 0x20212138 (Data = 0xAF00B480)
On "step" command, the GDB Server goes crazy, spamming
...Target halted (DBGRQ, PC = 0x20212138)
Reading all registers
Performing single step...
...Target halted (DBGRQ, PC = 0x20212138)
Reading all registers
Performing single step...
So it basically never leaves that line. some sort of trap?