Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

manual gdb and linux #26

Open
Evanok opened this issue Mar 18, 2024 · 0 comments
Open

manual gdb and linux #26

Evanok opened this issue Mar 18, 2024 · 0 comments

Comments

@Evanok
Copy link

Evanok commented Mar 18, 2024

Hello,

Thanks for this great tool. I am trying to use your repo to have gdb working on my teensy4.1.
But this is not working. I am not sure that my process is correct.

This is my current process:

  • adding the two cpp files gdbstub.cpp and TeensyDebug.cpp into my cmakefile
  • Replacing USB_SERIAL CFLAGS by USB_DUAL_SERIAL
  • Using --ggdb and -O1 as CFLAGS instead of -O3. This is a custom firmware and for unknown reason my
    firmware does not boot with -O0 :(.
  • Include TeensyDebug.h into my firmware code.
  • Adding debug.begin(SerialUSB1); in my setup code to enable the second serial port using for gdb.
  • Calling halt_cpu() at the end of my setup function.
  • Flashing the firmware
  • Now I can see two serial port available instead of one. I have now /dev/ttyACM1 available
  • Running the gdb builtin from my toolchain with the elf firmware binary:
[arthur * gdb_test] arm-none-eabi-gdb PARDI_Firmware.elf -ex "target remote /dev/ttyACM1"
GNU gdb (Arm GNU Toolchain 13.2.rel1 (Build arm-13.7)) 13.2.90.20231008-git
This GDB was configured as "--host=x86_64-pc-linux-gnu --target=arm-none-eabi".
(...)
Reading symbols from PARDI_Firmware.elf...
Remote debugging using /dev/ttyACM1
Ignoring packet error, continuing...
warning: unrecognized item "timeout" in "qSupported" response
Ignoring packet error, continuing...
Remote replied unexpectedly to 'vMustReplyEmpty': timeout
(gdb) exit

From my I can see in my first serial port, the loop is running even if I am calling the halt cpu function in the setup. Is it expected?
Is there something wrong in my process?

Thanks,
Arthur.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant