Skip to content

RP2040: Issuing run disconnects the target #1295

@xobs

Description

@xobs

Under some circumstances, it seems as though issuing a run command disconnects the target. For example, when attempting to load tinyusb_dev_cdc_dual_ports.elf:

Reading symbols from E:\Code\Farpatch\tinyusb_dev_cdc_dual_ports.elf...done.
(gdb) tar ext \\.\COM54
Remote debugging using \\.\COM54
(gdb) mon ver
Black Magic Probev1.8.0-903-g22139ea9, Hardware Version 6
Copyright (C) 2022 Black Magic Debug Project
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

(gdb) mon s
Target voltage: 3.3V
Available Targets:
No. Att Driver
 1      Raspberry RP2040 M0+
 2      Raspberry RP2040 M0+
 3      Raspberry RP2040 Rescue (Attach to reset!)
(gdb) att 1
Attaching to program: E:\Code\Farpatch\tinyusb_dev_cdc_dual_ports.elf, Remote target
0x100011a0 in alarm_pool_get_default () at /opt/Pico/pico-sdk/src/common/pico_time/time.c:93
93      /opt/Pico/pico-sdk/src/common/pico_time/time.c: No such file or directory.
(gdb) load
Loading section .boot2, size 0x100 lma 0x10000000
Loading section .text, size 0x6f20 lma 0x10000100
Loading section .rodata, size 0x1638 lma 0x10007020
Loading section .binary_info, size 0x28 lma 0x10008658
Loading section .data, size 0x330 lma 0x10008680
Loading section .uninitialized_ram.magic_location, size 0xc lma 0x100089b0
Start address 0x100001e8, load size 35260
Transfer rate: 51 KB/sec, 881 bytes/write.
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: E:\Code\Farpatch\tinyusb_dev_cdc_dual_ports.elf
You are now detached from the previous target.

Program terminated with signal SIGLOST, Resource lost.
The program no longer exists.
[New Thread 1]
Remote failure reply: EFF
Remote failure reply: EFF
(gdb)

When the board gets into this state, it behaves very oddly:

Remote failure reply: EFF
Remote failure reply: EFF
(gdb) mon erase_mass
Target does not support this command.
(gdb) att 1
A program is being debugged already.  Kill it? (y or n) y
Attaching to program: E:\Code\Farpatch\tinyusb_dev_cdc_dual_ports.elf, Remote target
Attaching to Remote target failed
(gdb) mon s
Target voltage: 3.3V
Available Targets:
No. Att Driver
 1      Raspberry RP2040 M0+
 2      Raspberry RP2040 M0+
 3      Raspberry RP2040 Rescue (Attach to reset!)
(gdb) att 1
Attaching to program: E:\Code\Farpatch\tinyusb_dev_cdc_dual_ports.elf, Remote target
0x000020f0 in ?? ()
(gdb) mon erase_mass
Erasing device Flash: .................................................done
Failed
(gdb)

This happens with tinyusb_dev_cdc_dual_ports.elf, and does not happen with the simple blink.elf. However, curiously enough I've found instances where blink.elf doesn't actually blink. In this case might it be that the second CPU isn't halted?

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugConfirmed bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions