Skip to content
New issue

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

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

Already on GitHub? # to your account

The 'extended-remote' command and Zephyr based firmwares #12

Open
kholia opened this issue Jun 5, 2024 · 0 comments
Open

The 'extended-remote' command and Zephyr based firmwares #12

kholia opened this issue Jun 5, 2024 · 0 comments

Comments

@kholia
Copy link

kholia commented Jun 5, 2024

Zephyr: https://www.zephyrproject.org/

The target extended-remote /dev/ttyACM0 GDB command seems to be buggy - at least for Zephyr firmwares. It gets stuck as follows:

(gdb) target extended-remote /dev/ttyACM0
Remote debugging using /dev/ttyACM0
arch_irq_unlock (key=8) at zephyr/include/zephyr/arch/riscv/arch.h:259
259             __asm__ volatile ("csrs mstatus, %0"
(gdb) c
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
arch_cpu_idle () at zephyr/arch/riscv/core/cpu_idle.c:14
14              irq_unlock(MSTATUS_IEN);
(gdb) c
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
arch_cpu_idle () at zephyr/arch/riscv/core/cpu_idle.c:14
14              irq_unlock(MSTATUS_IEN);
(gdb)
Continuing.

<Never ends>

With target remote /dev/ttyACM0, debugging works great!

(gdb) target remote /dev/ttyACM0
(gdb) break k_msleep
Breakpoint 1 at 0xdc6: file zephyr/include/generated/zephyr/syscalls/kernel.h, line 135.
Note: automatically using hardware breakpoints for read-only addresses.
(gdb) c
Continuing.

Breakpoint 1, k_msleep (ms=1000) at zephyr/include/zephyr/kernel.h:491
491             return k_sleep(Z_TIMEOUT_MS(ms));
(gdb) c
Continuing.

Breakpoint 1, k_msleep (ms=1000) at zephyr/include/zephyr/kernel.h:491
491             return k_sleep(Z_TIMEOUT_MS(ms));
(gdb) c
Continuing.

Sample blinky firmware: zephyr.elf.zip

Related: zephyrproject-rtos/zephyr#73761.

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

No branches or pull requests

1 participant