2024-04-11 05:45 PM - edited 2024-04-11 06:37 PM
HI!
I am trying to program a custom STM32F446 Board using the SWD connections on the board. When trying to flash the custom board I receive the following error on OpenOcd:
xPack Open On-Chip Debugger 0.12.0+dev-01312-g18281b0c4-dirty (2023-09-04-22:32)
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 : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 2000 kHz
Info : STLINK V3J13M4B5S1 (API v3) VID:PID 0483:374F
Info : Target voltage: 0.003198
Error: target voltage may be too low for reliable debugging
Error: init mode failed (unable to connect to the target)
I have a 6 pin 01x06 pin male connector on the custom board for SWD, which connects to the appropriate pins on the STM32. Here is the board connection schematic:
Hopefully the image is visible.
I have tried updating drivers on my computer for the STlink using the provided driver executable, but that doesnt seem to be the problem. I have also tried the solutions provided on this page:Forum Solution
None of these work for me. I will also add a picture of my HW setup rn:
I dont understand whats the cause for this problem. Any help or advice would be much appreciated!
Edit: I used STMCubeIDE to try to program the custom board, using the gdb server with SWD option. I got the following error:
STMicroelectronics ST-LINK GDB server. Version 7.5.0
Copyright (c) 2023, STMicroelectronics. All rights reserved.
Starting server with the following options:
Persistent Mode : Disabled
Logging Level : 1
Listen Port Number : 61234
Status Refresh Delay : 15s
Verbose Mode : Disabled
SWD Debug : Enabled
InitWhile : Enabled
Target no device found
Error in initializing ST-LINK device.
Reason: No device found on target.
Error in final launch sequence:
Failed to execute MI command:
target remote localhost:61234
Error message from debugger back end:
localhost:61234: Connection timed out.
Failed to execute MI command:
target remote localhost:61234
Error message from debugger back end:
localhost:61234: Connection timed out.
localhost:61234: Connection timed out.
2024-04-11 07:04 PM
I might be the dumbest person alive (atleast from what I have read online 🙂 )
You need to provide the STM32 with your own external power, the STlink SWD Vcc connection doesnt power the board itself!
2024-04-11 08:39 PM
I added an external source, and tried again but this time the init failed:
Heres the error message:
xPack Open On-Chip Debugger 0.12.0+dev-01312-g18281b0c4-dirty (2023-09-04-22:32)
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 : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 2000 kHz
Info : STLINK V3J13M4B5S1 (API v3) VID:PID 0483:374F
Info : Target voltage: 3.290606
Error: init mode failed (unable to connect to the target)
This might be hardware issue but I cannot tell
2024-04-11 08:59 PM
NRST is getting voltage (~3.3V) so its driven high
The STM32 Chip also has a constant 3.3V on the VDD.
Cant figure out why the OpenOCD or STM32CubeIde cant find target.