I’m trying to code something for this generic STM32F103 – known as blue pill – thru eclipse + arm plugins +openocd and a generic STLink V2
Well, I couldn’t make it work. I’ve followed the steps listed here, I have set the parameteres for opencd as: -f hinterface/stlink-v2.cfg -f target/stm32f1x.cfg
Then, the debugger starts, the stlink starts blinks (and doesn’t stop blinking until I stop the debugger) but nothing else happens. No messages are displayed in console, no variables are shown in debugger windows, and it doesn’t stop running too.
The STlink dongle is working pretty well with arduino ide. So I guess I have no hardware problems here.
Did anyone out there succeded in using eclipse+blue pill ? Please tell me how.
It is best to install the minimal eclipse, then add the CDT, GDB and other support. Using the package installers brings over a lot of extra stuff.
Eclipse has a lot of options, there are at least three different ways to use STM32 with it.
1) AC6 Software workbench. This is best for pure code using ST’s CUBEMX and the HAL Libraries. This is not really Arduino friendly.
2) makefiles. Point the Eclipse at the Arduino cross compilers. Point the GDB tools at the ST link interface. Either hand edit a make file or use a scripting language like Python or postscript to create the make file. The tricky part is getting the source tree set up so that eclipse does not complain about a zillion pre-processing errors in the Arduino core.
3) install an eclipse Arduino environment. I have not tried that one. Supposedly it allows for use of the .ino sketch folders and the processing pre-processor.
There are probably others.
The biggest issue with eclipse is that projects are kept in private workspaces. These in turn contain copies if the code, so it makes for having files outside the eclipse/git SCM to be problematic. Eclipse also tends to use these copies for the pre-processor checks and expects a nice orderly project source tree. I had to do a lot of hacking of the project XML as I got tired of typing the same file paths over and over into the project options menus, half the time which I can not find.
The next issue is the linker scripts. If your linker script does not match the IDE, then you get exceptions at the code start and the board just hangs. The linker script is where the reset vectors and the code blocks are stored. It works with the assembly .S file to place the code modules into the right places. More confusing is there is a difference between .s files and .S file as these are case sensitive.
Also watch for the SWD pins being disabled after the code is loaded. This one got me a few times.
It may be the way I set up GDB in eclipse, a lot of the time I have to telnet/ssh into the GDB server and kill it as the eclipse does not seem to terminate it. Especially after a reset vector hang.
? shouldn’t that be -f interface/stlink-v2.cfg
? shouldn’t that be -f interface/stlink-v2.cfg
So it may have something to do with project settings.
Alternatively, you may try to combine PlatformIO with Eclipse.
Also watch for the SWD pins being disabled after the code is loaded. This one got me a few times.
Could you say more about that? How do someone enable or disable the swd pins ?
-DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1note that the in the f103 codes, there is this particular define CONFIG_MAPLE_MINI_NO_DISABLE_DEBUG
if you do not set this define, the jtag and maybe swd pins would be disabled. hence you can’t connect via swd/jtag
this is used in the variant files e.g. STM32F1/variants/maple_mini/board.cpp
/* Since we want the Serial Wire/JTAG pins as GPIOs, disable both SW
* and JTAG debug support, unless configured otherwise. */
void boardInit(void) {
#ifndef CONFIG_MAPLE_MINI_NO_DISABLE_DEBUG
disableDebugPorts();
#endif
}
I can send you my settings or something so you could try.
Do you get some error from gdb or it just hangs?
If you get error try to hold reset while entering debugging mode and on first show of gdb release reset.
That is needed only first time (I think it is when you use board with arduino first…)
i keep going back around the loop from eclipse, …, …, ac6 and trying each, never seem to get very far.
eclipse, gnuarmeclipse and system workbench all seem to want use of a config directory dot/dot eclipse also a dot/dot p2, dot/ dot ac6.
ok some are program specific, but starting a tree from their own names might be a good start
all exceedingly annoying.
currently with system workbench (ac6) just because that’s what CubeMX wants to use and i’ve no idea how to change that
stephen
will do post with screens
As I can remember it is just eclipse neon with gnu arm plugins (and lots of settings to get it work )…
I just copy pasted my pic here so try to spot differences
https://yadi.sk/d/bPKhpIVT3JypQQ
and one impressive article that help me with just one settings (OS_USE_TRACExxxxxx) is here
http://www.count-zero.ru/2016/stm32_intro/

![[SOLVED] Discovery STM32F100RB — Trouble with timers and library structure](https://sparklogic.ru/wp-content/uploads/2019/11/st-stm32vl-discovery-90x90.jpg)
