I ran through the instructions that you provided here -> https://github.com/stm32duino/wiki/wiki/How-to-debug
Sloeber complained about my install path being over 40 chars, so I followed the advice here -> https://github.com/Sloeber/arduino-ecli … issues/705 so I could run eclipse from within a temp M: drive using subst.
I can successfully build and upload code to a bluepill, but when I try debug I have no luck.
OpenOCD.exe starts fine
But I get this output:
GNU MCU Eclipse 64-bit Open On-Chip Debugger 0.10.0+dev-00352-gaa6c7e9b (2018-10-20-06:24)
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
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
none separate
Started by GNU MCU Eclipse
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : clock speed 950 kHz
Error: open failed
in procedure 'init'
in procedure 'ocd_bouncer'
Error in final launch sequence
Failed to execute MI command:
-target-select remote localhost:3333
Error message from debugger back end:
localhost:3333: No connection could be made because the target machine actively refused it.
Failed to execute MI command:
-target-select remote localhost:3333
Error message from debugger back end:
localhost:3333: No connection could be made because the target machine actively refused it.
localhost:3333: No connection could be made because the target machine actively refused it.
Do you use the proper USB cable?
I’m joke
Googling your issue, it seems it could be related on USB port use. Is it an USB 3 port ?
Other question, did you update the stlink firmware ?
St-Link is at latest firmware.
Thanks.
PS, you mean this SCART lead won’t work? ![]()
Anyway I also seen that boards connected on USB3 port seems work on a limited mode….
Have a nice debug ![]()
Bit of a learning curve:
* Custom libraries – it doesn’t like them – I managed to frig them in by including a false version number subfolder in the library folder which contained the source
* any typedef’s or constants defined in a .h will cause a compile error if you have that .h explicitly included. Sloeber builds a sloeber.ino.cpp with all the includes and for some reason that leads to double definitions, but not for anything else?? So comment out includes in main project.
* build_opts.h is ignored – had to manually instantiate Serial3
Compiles and uploads though – and the eclipse/sloeber IDE has already helped me spot some goofs, = instead of == etc.
[BennehBoy – Tue Jan 15, 2019 7:46 pm] –
* any typedef’s or constants defined in a .h will cause a compile error if you have that .h explicitly included. Sloeber builds a sloeber.ino.cpp with all the includes and for some reason that leads to double definitions, but not for anything else?? So comment out includes in main project.
look into #pragma once
Seems not so easy… sorry
About .h, I guess contact Jantje could be fine. (Github issue?)
About build_opt.h, I need to test but think about it I guess it attempt to have it in folder sketch. Get back on this.
[fpiSTM – Tue Jan 15, 2019 8:23 pm] –
Never try with custom library…
Seems not so easy… sorry![]()
I cheated it – and my cheat worked ![]()
[Rick Kimball – Tue Jan 15, 2019 7:57 pm] –
look into #pragma once
Cool, thanks.
EDIT – worked a charm, doffs cap.
In Properties window, then “C/C++ Build-> Environnement”, the A.BUILD_OPT.SOURCEPATH is not correct.
It is expand as /build_opt.h
Under Arduino IDE, this check in sketch folder if file exist if not an empty one is created else it is copied by Arduino IDE Stuff to the build directory in sketch folder.
Unfortunately this step is not reproduced with Sloeber that’s why even if A.BUILD_OPT.SOURCEPATH find the file it is not copied.
As a workaround, I’ve set A.BUILD_OPT.SOURCEPATH to be equal to A.BUILD_OPT.PATH
Then in the build dir under Eclipse, in sketch folder I create or update the build_opt.h file.
Then clean the project to force rebuild all. Like this it is ok.

