When debugging my STM32F4-Discovery using gdb on command line, my gdb complains that "cannot find bounds of current function". Could anyone please help me understand the problem and cause?
I generated a project using STM32CubeMX. In the initial setting window I selected STM32F4-Discovery board and then generated codes without changing the default settings(pinout, clock configuration and etc). The project generated here is not for an IDE but for Makefile. After compiling the skeleton-like source code, I tried debugging with the output(.elf) file and gdb. But I only have the error messages shown below.
(gdb) target remote localhost:4242
Remote debugging using localhost:4242
0x00000000 in ??
(gdb) break main
Breakpoint 1 at 0x80007cc: file Src/main.c, line 68.
Cannot find bounds of current function
This is strange, because I don't have such problem when I do the same thing for my STM32L476-Discovery board. I can compile, flash, and trace the I/O register values of the MCU using gdb. I tried to edit the Makefile but couldn't solve the problem yet.
This is the project I generated.
You could download the project. The makefile assumes that you would use the arm-none-eabi tools uploaded in the same repository.