Debugging fails

Hi,

I recently got Field and ST-Link V3 MINIE.

Seems like I am struggling to connect the debugger.

First of all, when the debugger is connected, I should or should not have the USB connection also or does that matter?

Second of all, could somebody be kind to help me find out where am I making mistake,

here’s my openocd output:

make program
openocd -s /usr/local/share/openocd/scripts -f interface/stlink.cfg -f target/stm32h7x.cfg \
		-c "program ./build/Blink.elf verify reset exit"
xPack Open On-Chip Debugger 0.12.0-01004-g9ea7f3d64-dirty (2023-01-30-17:05)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : clock speed 1800 kHz
Info : STLINK V3J8M3 (API v3) VID:PID 0483:3754
Info : Target voltage: 3.203206
Info : [stm32h7x.cpu0] Cortex-M7 r1p1 processor detected
Info : [stm32h7x.cpu0] target has 8 breakpoints, 4 watchpoints
Error: read_memory: read at 0x5c001004 with width=32 and count=1 failed
Error executing event examine-end on target stm32h7x.cpu0:
/usr/local/share/openocd/scripts/target/stm32h7x.cfg:237: Error: read_memory: failed to read memory
in procedure 'program' 
in procedure 'stm32h7x_dbgmcu_mmw' called at file "/usr/local/share/openocd/scripts/target/stm32h7x.cfg", line 176
in procedure 'stm32h7x_mmw' called at file "/usr/local/share/openocd/scripts/target/stm32h7x.cfg", line 260
in procedure 'stm32h7x_mrw' called at file "/usr/local/share/openocd/scripts/target/stm32h7x.cfg", line 242
at file "/usr/local/share/openocd/scripts/target/stm32h7x.cfg", line 237
Info : starting gdb server for stm32h7x.cpu0 on 3333
Info : Listening on port 3333 for gdb connections
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
Error: read_memory: read at 0x5c001004 with width=32 and count=1 failed
Error executing event examine-end on target stm32h7x.cpu0:
/usr/local/share/openocd/scripts/target/stm32h7x.cfg:237: Error: read_memory: failed to read memory
in procedure 'program' 
in procedure 'ocd_process_reset' 
in procedure 'ocd_process_reset_inner' called at file "embedded:startup.tcl", line 1193
in procedure 'stm32h7x_dbgmcu_mmw' called at file "/usr/local/share/openocd/scripts/target/stm32h7x.cfg", line 170
in procedure 'stm32h7x_mmw' called at file "/usr/local/share/openocd/scripts/target/stm32h7x.cfg", line 260
in procedure 'stm32h7x_mrw' called at file "/usr/local/share/openocd/scripts/target/stm32h7x.cfg", line 242
at file "/usr/local/share/openocd/scripts/target/stm32h7x.cfg", line 237
** Unable to reset target **
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
shutdown command invoked

make: *** [program] Error 1

Thanks in advance,
Sina

You need to power the Daisy when using STLINK. If it’s a Seed, you can power by USB or the power pins. If it’s a patch.Init(), it can be powered by Eurorack case.

@tele_player thanks for getting back to me this quick!

I am using Field and it is currently connected to the power.

Do I need to connect the USB on Seed as well?

As long as the Seed is getting power, you’re good. So, no, you don’t need to connect USB to Seed.
I’ve never used a Field, so I don’t know if maybe there is some way it interferes, but there shouldn’t be.

Are you sure the stlink cable is properly connected?
Have you successfully programmed using make-dfu?
What OS are you using, Mac, Linux, Windows?

@tele_player I connected the stlink cable as described here, 1. Setting Up Your Development Environment · electro-smith/DaisyWiki Wiki · GitHub

I successfully programmed using make program-dfu through the USB connection.

If I try the same command while only connected through the stlink, I get the following error,

make program-dfu
dfu-util -a 0 -s 0x08000000:leave -D build/Blink.bin -d ,0483:df11
dfu-util 0.11

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2021 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

dfu-util: Warning: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release
dfu-util: No DFU capable USB device available
make: *** [program-dfu] Error 74

I am on MacOS X Ventura (Apple Silicon M2).