2021-03-29 01:13 PM
I'm trying to use a ST-LINKv2 to re-program a consumer device that I know has an STM32 of some kind inside (fairly sure it's a STM32L-something). I found four headers on the board that a continuity tester has shown to be Vdd, Vcc, SCLK, and SWDIO.
Connecting with only those 4 wires did not allow STM32CubeProgrammer to connect to the device. It gives the message "No STM32 target found!". Same with the ST-Link Utility. So I next tried tying boot0 high (w/ and w/out a 1k resistor). I have confirmed that this prevents the device's normal program from starting. Connection still fails. I then tried connecting NRST to the ST-LINK so that it could control hardware-reset. I can verify that trying to connect to the device does reset it over NRST. But it still can't connect
Port: SWD
Frequency: 100kHz
Mode: Under reset
Reset mode: Hardware Reset
Output:
12:57:17 : ST-LINK SN : 55FF6E066684564922161687
12:57:17 : ST-LINK FW : V2J37S7
12:57:17 : Board : --
12:57:17 : Voltage : 1.05V
12:57:17 : Error: No STM32 target found!
If I increase the frequency to 4000kHz, then the error changes to: "Error: ST-LINK error (DEV_TARGET_CMD_ERR)"
I've tried so many combinations of configurations, swapped the CLK/IO pins just to be sure, updated the ST-LINK firmware, but nothing fixes the connection. Am I missing something obvious here? Is it possible that the chip is locked-down during manufacturing so that it can't be modified?
2021-04-18 06:52 PM
False alarm! I accidentally had the reset jumper tied low from testing a previous theory. I can now read meaningful data.
~ >>> sudo openocd -f interface/stlink.cfg -f target/stm32l5x.cfg -c 'init' -c 'reset init' -c 'mdw 0x0BFA0590 9' -c 'exit'
Open On-Chip Debugger 0.11.0
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 500 kHz
Info : STLINK V2J29S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 2.806299
Info : stm32l5x.cpu: hardware has 8 breakpoints, 4 watchpoints
Info : starting gdb server for stm32l5x.cpu on 3333
Info : Listening on port 3333 for gdb connections
target halted due to debug-request, current mode: Thread
xPSR: 0xf9000000 pc: 0xfffffffe msp: 0xfffffffc
0x0bfa0590: 00150010 59505003 20373858 ffffffff ffffff1b ffffffff 06750405 ffffffff
This topic can be considered closed I guess, as far as I can tell, I have full access to the device. Thank so much for your help @Community member , @Uwe Bonnes and @Community member