STMCubeProgrammer API "int connectStLink(debugConnectParameters debugParameters);" issue
- January 31, 2024
- 1 reply
- 2392 views
Hello!
I am using STM32 Cube Programmer API to flash a device with ST-LINK. I am using ST-LINK example 1. When I use connectStLink(debugParameters) it returns the value '-545'. Doxygen comments say that if it returns 0 the connection was successful, otherwise an error occurred. I can't find any more documentation about it. Surely the value '-545' indicates to some specific error. After using the getStLinkList() function, the debugConnectParameters look okay, so it means it gets a connection with the device.
I can flash (debug) the device through VS Code (using the official STM32 VS Code Extension) and through the STM32CubeProgrammer app with no problems. During one runtime, after a couple of unsuccessful tries it actually flashed the device for a few times and then stopped working again (returnind -545). I haven't made any changes to the code or the connections.
I am using mikroProg for STM32 with the ST-LINK V2 adapter. I tried different USB ports with no luck.
There isn't much information about the API and seems like not a lot of people use it also. I'm still hopeful that someone can help me.
