So I've been hacking away at getting some kind of debugging going on the giga. J-link didn't work out, so I'm trying the ST-link. I used the instructions here [post 12] (Debug GIGA using IDE2 Debugger? - #11 by ptillisch) , but got the error below. Any suggestions? I can't make heads or tails out of the error message. When I connected the ST-link, the winusb.sys driver was installed. Any help appreciated!!
Update: moved to a different machine, installed ST-Link USB driver (STSW-LINK009). Maybe I wasn't supposed to do that? The STLink documentation says the [supported IDE] will handle that, but don't list Arduino IDE as supported. The debug probe shows up in device manager with WinUSB.sys as the driver. Anyway, I got the following error. Again, any help appreciated.
BlockquoteCDRTOSConfigure
hla_swd
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : Listening on port 50001 for tcl connections
Info : Listening on port 50002 for telnet connections
Info : clock speed 1800 kHz
Info : STLINK V3J8M3B5S1 (API v3) VID:PID 0483:374F
Info : Target voltage: 3.206910
Warn : target stm32h7x.cpu0 examination failed
Error: jtag status contains invalid mode value - communication failure
Polling target stm32h7x.cpu0 failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target stm32h7x.cpu0 failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 300ms
Info : starting gdb server for stm32h7x.cpu0 on 50000
Info : Listening on port 50000 for gdb connections
Info : accepting 'gdb' connection on tcp/50000
Warn : target was in unknown state when halt was requested
Error executing event gdb-attach on target stm32h7x.cpu0:
Error: auto_probe failed
Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for GDB connect, or use 'gdb_memory_map disable'.
Error: attempted 'gdb' connection rejected
[2024-08-03T23:21:48.965Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed
GDB server session ended. This terminal will be reused, waiting for next session to start...
I also have the same exact issue with using STlinkV3 to debug. Can someone please help.
CDRTOSConfigure
hla_swd
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : Listening on port 50001 for tcl connections
Info : Listening on port 50002 for telnet connections
Info : clock speed 1800 kHz
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Info : STLINK V3J4M2B3S1 (API v3) VID:PID 0483:374F
Info : Target voltage: 3.225498
Warn : target stm32h7x.cpu0 examination failed
Error: jtag status contains invalid mode value - communication failure
Polling target stm32h7x.cpu0 failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target stm32h7x.cpu0 failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 300ms
Info : starting gdb server for stm32h7x.cpu0 on 50000
Info : Listening on port 50000 for gdb connections
Info : accepting 'gdb' connection on tcp/50000
Warn : target was in unknown state when halt was requested
Error executing event gdb-attach on target stm32h7x.cpu0:
Error: auto_probe failed
Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for GDB connect, or use 'gdb_memory_map disable'.
Error: attempted 'gdb' connection rejected
[2024-08-15T14:17:56.292Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed
GDB server session ended. This terminal will be reused, waiting for next session to start...
@ptillisch
This is probably a dumb question!!
To debug, I am using ST Link V3 (still figuring out debug issue), so connected to the JTAG port on the board and USB side to the computer, but I also need to connect the USB-C cable to power the board? Now, I see Giga board from 2 COM ports on the IDE (one from JTAG and other from USB-C). Which one should I use ?
is the JTAG cable supposed to power the board too ?
Please let me know.
Hi @shivamadishetty. Unfortunately I don't have any experience with the ST-LINK V3, and don't have access to one.
Some debug probes do provide power to the target. Others might get fancy and not power the board, but instead use that connection in order to sense the target's Vcc voltage in order to automatically use the correct logic levels.
I recommend you consult the documentation for the ST-LINK V3. I would guess the information will be provided there.
Hi shivamadishetty,
I never did, and I've given up. How about you - any luck? I've spent too much of my life hacking on the arduino giga debug situation, and at this point it's throwing good time after bad, so to speak. I had something of a similar disappointment with the zero, where the debugging worked, but wasn't stable. I was also disappointed with the giga platform; in my opinion, the claims of what you can do with it often exceed reality, given the library support. For my current giga project (which is pretty far behind schedule) I went back to serial.print troubleshooting, which is primitive, but it does work. One bright spot for the giga was Adafruit GFX, which has great documentation and worked like a charm. I may be wrong to expect good, high functioning libraries - and if so, I hope the good folks here will set me straight. I'm not an accomplished coder, though, and to write/fix/improve/hack libraries and debugging tools is often a goose chase for me.
Next time I need a debugger (a great learning tool, probably) I'm going to try vscode/platformio. That'll also take time, but at this point I think there is more future in it. If that means dumping the giga platform, then so be it.
Finally - lest I sound negative - I appreciate the tremendous amount of work that's gone into the arduino hardware and software. It's a major accomplishment, and I've managed to recall & learn a lot from using it.