ilg-archived / openocd

The GNU MCU Eclipse OpenOCD
http://gnuarmeclipse.github.io/openocd/
GNU General Public License v2.0
234 stars 62 forks source link

Unexpected "Remote connection closed" with GDB PIPE and RISC-V #25

Closed ivankravets closed 5 years ago

ivankravets commented 6 years ago

We had a similar problem with ARM before which was resolved a few months ago (https://github.com/gnu-mcu-eclipse/openocd/issues/18). The similar issue could be reproduced for RISC-V now:

(gdb) target remote | openocd -c "gdb_port pipe" -f openocd/scripts/board/sifive-hifive1.cfg
Remote debugging using | openocd -c "gdb_port pipe" -f openocd/scripts/board/sifive-hifive1.cfg
GNU MCU Eclipse 64-bits Open On-Chip Debugger 0.10.0+dev-00392-gbe9ef0b0 (2018-01-12-16:51)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
adapter speed: 10000 kHz
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi_tdo_sample_edge falling"
Info : clock speed 10000 kHz
Info : JTAG tap: riscv.cpu tap/device found: 0x10e31913 (mfg: 0x489 (SiFive, Inc.), part: 0x0e31, ver: 0x1)
Info : [0] Found 2 triggers
halted at 0x204001e2 due to debug interrupt
Info : Examined RISCV core; XLEN=32, misa=0x40001105
Info : Found flash device 'issi is25lp128' (ID 0x0018609d)
cleared protection for sectors 64 through 255 on flash bank 0
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : accepting 'gdb' connection from pipe
Info : dropped 'gdb' connection
Remote connection closed
(gdb)

/cc @palmer-dabbelt

ilg-ul commented 6 years ago

I have no idea what was wrong, I'm only tracking both the main repo and the risc-v repo.

I'll try to update, but I'd rather wait for the risc-v fork to be upstreamed, there are too many differences to accommodate.

ivankravets commented 6 years ago

I tried RISC-V fork. The same problem. What is interesting, it works good on Linux.

ilg-ul commented 6 years ago

I tried RISC-V fork. The same problem.

then open a ticket there.

ilg-ul commented 6 years ago

I just released 0.10.0-8, with the latest commits. There are many cleanups in the RISC-V code.

Could you check if the problem was solved?

ivankravets commented 6 years ago

Thanks for the update. I've just tested and still can reproduce this issue.

ilg-ul commented 6 years ago

It means the problem is caused by the RISC-V patches.

It'll take some time to clean the RISC-V patches. I suggest you also complain to the RISC-V OpenOCD maintainers.

ivankravets commented 6 years ago

I suggest you also complain to the RISC-V OpenOCD maintainers. I did https://github.com/riscv/riscv-openocd/issues/234

Meanwhile, we disabled PIPE mode for RISC-V openOCD and use TCP port to communicate with their boards.

ilg-ul commented 5 years ago

could you retry with the latest release (*-10)?

maskimthedog commented 5 years ago

This issue is kills my ability to use Code Confidence plugin.

maskimthedog commented 5 years ago

...on Windows 10 that is with System Workbench and STLink V2.

ilg-ul commented 5 years ago

I suggest you repeat the same test using the Windows binaries packed by Freddy Chopin and let me know the result.

I am aware of some problems introduced by the RISC-V patches in previous releases, but the latest -10 release should be clean, I removed most of the RISC-V patches in the common code.

ilg-ul commented 5 years ago

I just released 0.10.0-12, with the latest upstream master.

Please check if the problem was solved. If not, reopen the ticket.

maskimthedog commented 5 years ago

Thank you. I will test.