Over the past few years I’ve been using the System Workbench for STM32 with little to no problems. About a month ago, I tried running some code on an F4 dev board. Strangely enough, nothing seemed to happen. When I attempted to debug, I was hit with an error from OpenOCD. I initially thought I must’ve deleted/moved some important files unknowingly, so I tried reinstalling Eclipse + STM32 software. With this setup, I couldn’t even build a project generated by CubeMX, let alone debug it (building an existing project works, but again cannot debug. I possibly just don’t know how to use the newer versions of cube).
Fast forward to today, I’ve gotten so frustrated downloading, installing, uninstalling, and reinstalling various combinations of software, I decided to completely reinstall Windows on my machine and start from scratch.
What I Did
If that fixed it, I obviously wouldn’t be making this post. At this point, I can only assume that I’m just missing some step in setting this up, so starting from this point, I’ll explicitly list the steps I took to get this running.
- Installed Windows 10, and update to current version (as of writing, version 1909)
- Installed JDK verion 13.0.1 (link now dead)
- Installed Eclipse 2019-12
- Downloaded the installer found here
- After launching the installer, I selected “Eclipse IDE for C/C++ Developers”, selected JDK 13.0.1, and saved to directory D:\Documents\Programming\eclipseC++\program
- Installed System Workbench for STM32 from Eclipse
- Went to Help -> Install new Software... -> Add
- Set ‘Name:’ as ‘System Workbench for STM32 - Bare Machine edition’, set ‘Location:’ as ‘http://ac6-tools.com/Eclipse-updates/org.openstm32.system-workbench.update-site-v2’
- Selected and installed ‘External Tools,’ ‘OpenSTM32 Tools,’ and ‘STM32-Copro-MPU’
- After installing, I restarted Eclipse when Prompted
- Installed ST-Link Driver v009
- Downloaded from here
- Ran stlink_winusb_install.bat
- Installed STM32CubeMX 5.5.0
- Downloaded from here
- Ran SetupSTM32CubeMX-5.5.0.exe
- Made a project
- File -> New Project -> STM32F446RE, downloaded firmware when prompted
- Under Project Manager
- Project Name: Test
- Project Location: D:\Documents\Programming\eclipseC++\projects
- Toolchain / IDE: SW4STM32
- Generate Code
- Once generated, I opened Eclipse and imported the new project
After step 4.4, I get this error upon opening Eclipse:
’Initializing External-tools’ has encountered a problem.
An internal error occurred during: “Initializing External-tools”.
Building my new project after step 8, I get this error:
C:\Users\aatca\AppData\Local\Temp\ccH0jd0c.s: Assembler messages:
C:\Users\aatca\AppData\Local\Temp\ccH0jd0c.s:295: Error: selected processor does not support `dsb 0xF’ in Thumb mode
C:\Users\aatca\AppData\Local\Temp\ccH0jd0c.s:306: Error: selected processor does not support `isb 0xF’ in Thumb mode
C:\Users\aatca\AppData\Local\Temp\ccH0jd0c.s:350: Error: selected processor does not support `dsb 0xF’ in Thumb mode
C:\Users\aatca\AppData\Local\Temp\ccH0jd0c.s:371: Error: selected processor does not support `dsb 0xF’ in Thumb mode
C:\Users\aatca\AppData\Local\Temp\ccH0jd0c.s:492: Error: selected processor does not support `dmb 0xF’ in Thumb mode
C:\Users\aatca\AppData\Local\Temp\ccH0jd0c.s:555: Error: selected processor does not support `dsb 0xF’ in Thumb mode
C:\Users\aatca\AppData\Local\Temp\ccH0jd0c.s:566: Error: selected processor does not support `isb 0xF’ in Thumb mode
Drivers/STM32F4xx_HAL_Driver/Src/subdir.mk:60: recipe for target ‘Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.o’ failed
make: *** Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.o Error 1
”make all” terminated with exit code 2. Build might be incomplete.
Compiling an existing project works fine. Running it gives this error:
An error has occurred. See error log for more details.
Could not initialize class fr.ac6.mcu.externaltools.stlinkserver.win32.WinRegistry
This also occurs when opening its Debug Configurations.
The error log contains:
java.lang.NoClassDefFoundError: Could not initialize class fr.ac6.mcu.externaltools.stlinkserver.win32.WinRegistry
After changing some things I unfortunately no longer remember, running existing projects now gives this error:
Wrong device detected
Open On-Chip Debugger 0.10.0+dev-00021-g524e8c8 (2019-04-12-08:48)
Licensed under GNU GPL v2
For bug reports, read http://openocd.org/doc/doxygen/bugs.html
srst_only separate srst_nogate srst_open_drain connect_assert_srst
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 12000 kHz
Info : clock speed 12000 kHz
Info : STLINK v2.1 JTAG v30 API v2 M19 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 3.269862
Error: init mode failed (unable to connect to the target)
in procedure ‘program’
in procedure ‘init’ called at file “embedded:startup.tcl”, line 495
in procedure ‘ocd_bouncer’
** OpenOCD init failed **
shutdown command invoked
Creating a project from scratch:
- File -> New -> C/C++ Project -> C Managed Build
- Project name “Test2”, Executable Ac6 STM32 MCU Project -> Next
- Board NUCLEO-F446RE -> Next
When I select “Hardware Abstraction Layer (Cube HAL)”, I get the warning:
Target firmware has not been found locally, please install it !
After clicking “Download target firmware” and accepting the agreement, the message “Look for locally installed firmware” is displayed for a few seconds, then it goes back to the same screen.
Clicking “Firmware Installation,” firmware repositiories in “C:\Users\aatca\AppData\Roaming\Ac6\SW4STM32\firmwares” and “C:\Users\aatca\STM32\Repository” are listed. In the AppData repo, there are only empty temp files (generated from clicking “Download target firmware”). In the other, I find a “STM32Cube_FW_F4_V1.24.2” directory with what I assume to be the required firmware.
Using SW4STM32 directly:
After downloading and running the latest installer for SW4STM32 here, running that version of eclipse gives this error on startup:
’Initializing GNU ARM GCC Compiler...’ has encountered a problem.
Failed to extract ‘C:\Program Files\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.externaltools.arm-none.win32_188.8.131.52812190825\tools\st-gnu-arm-gcc-7-2018-q2-update_gdb-5_4-2016q3-win32.zip’ to ‘C:\Program Files\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.externaltools.arm-none.win32_184.108.40.206812190825\tools\compiler’
I get about a dozen of these if I try to do anything with projects (i.e. build project, check properties, etc.).
- I’ve tried on multiple F4s, all with the same problem, so faulty hardware isn’t an issue.
- The section in Properties -> C/C++ Build -> Settings are organized completely differently between existing vs newly generated projects, so I cannot directly compare what I could change there to make building work.
- New projects do not show up under Debug Configurations, and I’m not sure how to add them.
Any insights as to what I’m missing would be greatly appreciated, as I’ve tried all I could thing of doing, and am completely stuck.