SW4STM32 and SW4Linux fully supports the STM32MP1 asymmetric multicore Cortex/A7+M4 MPUs

   With System Workbench for Linux, Embedded Linux on the STM32MP1 family of MPUs from ST was never as simple to build and maintain, even for newcomers in the Linux world. And, if you install System Workbench for Linux in System Workbench for STM32 you can seamlessly develop and debug asymmetric applications running partly on Linux, partly on the Cortex-M4.
You can get more information from the ac6-tools website and download (registration required) various documents highlighting:

System Workbench for STM32

Issues Installing System Workbench for STM32 from Eclipse

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.

  1. Installed Windows 10, and update to current version (as of writing, version 1909)
  2. Installed JDK verion 13.0.1 (link now dead)
  3. Installed Eclipse 2019-12
    1. Downloaded the installer found hereQuestion
    2. 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
  4. Installed System Workbench for STM32 from Eclipse
    1. Went to Help -> Install new Software... -> Add
    2. 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’
    3. Selected and installed ‘External Tools,’ ‘OpenSTM32 Tools,’ and ‘STM32-Copro-MPU’
    4. After installing, I restarted Eclipse when Prompted
  5. Installed ST-Link Driver v009
    1. Downloaded from hereQuestion
    2. Ran stlink_winusb_install.bat
  6. Installed STM32CubeMX 5.5.0
    1. Downloaded from hereQuestion
    2. Ran SetupSTM32CubeMX-5.5.0.exe
  7. Made a project
    1. File -> New Project -> STM32F446RE, downloaded firmware when prompted
    2. Under Project Manager
      1. Project Name: Test
      2. Project Location: D:\Documents\Programming\eclipseC++\projects
      3. Toolchain / IDE: SW4STM32
    3. Generate Code
  8. Once generated, I opened Eclipse and imported the new project

The Problems:

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.htmlQuestion
     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
     adapter_nsrst_delay: 100
     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:

  1. File -> New -> C/C++ Project -> C Managed Build
  2. Project name “Test2”, Executable Ac6 STM32 MCU Project -> Next
  3. 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 hereQuestion, 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_1.17.0.201812190825\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_1.17.0.201812190825\tools\compiler’
I get about a dozen of these if I try to do anything with projects (i.e. build project, check properties, etc.).

Further notes:

  • 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.

Hi, I feel for ya. I’ve been there. I’m new to embedded stuff but this isn’t “my first rodeo” so here are my observations:

‘’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”.

I was getting that error before installing the ac6 tools. weird.

C:\Users\aatca\AppData\Local\Temp\ccH0jd0c.s:295: Error: selected processor does not support `dsb 0xF’ in Thumb mode

This error suggests you’re using the wrong board setup or the wrong compiler? Those items are in your project properties so changing your installation won’t likely fix that.

Your board settings are in project properties, open C/C++ Build -> Settings -> Target. Remember, these settings are Configuration specific so check Debug and Build settings. Make sure these are correct.

A couple debugging suggestions:
In your project properties, open C/C++ Build -> Settings -> Tool Settings Tab -> MCU Settings
- Prefix should say “arm-none-eabi-”
- Path should say ${openstm32_compiler_path}
What does MCU and Board say? Does it match your board?

In your project properties, open C/C++ Build -> Settings -> Tool Settings Tab -> MCU GCC Compiler
- What does the “All options” say? Does it match your board? The MCU settings above?

What does the compiler output look like when you build? This is my output:
Building file: ../StdPeriph_Driver/src/stm32f4xx_crc.c
Invoking: MCU GCC Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DSTM32 ‘-DHSE_VALUE=20000000’ -DSTM32F4 -DSTM32F446RETx -DDEBUG -DSTM32F446xx -DUSE_STDPERIPH_DRIVER -I”C:/Users/russh/myproj/StdPeriph_Driver/inc” -I”C:/Users/russh/myproj/inc” -I”C:/Users/russh/myproj/CMSIS/device” -I”C:/Users/russh/myproj/CMSIS/core” -O1 -g3 -Wall -fmessage-length=0 -ffunction-sections -c -MMD -MP -MF”StdPeriph_Driver/src/stm32f4xx_crc.d” -MT”StdPeriph_Driver/src/stm32f4xx_crc.o” -o “StdPeriph_Driver/src/stm32f4xx_crc.o” “../StdPeriph_Driver/src/stm32f4xx_crc.c”
Finished building: ../StdPeriph_Driver/src/stm32f4xx_adc.c

This is the important bit:
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DSTM32 ‘-DHSE_VALUE=20000000’ -DSTM32F4 -DSTM32F446RETx -DDEBUG -DSTM32F446xx -DUSE_STDPERIPH_DRIVER

It needs to match your board. If you don’t see arm-none-eabi-gcc that’s a bit hint that you’r using the wrong compiler.
If the board info is wrong, then you can fix that in the Target tab.

java.lang.NoClassDefFoundError: Could not initialize class fr.ac6.mcu.externaltools.stlinkserver.win32.WinRegistry
This is the error that brought me here so I have no idea. ;)

‘’After changing some things I unfortunately no longer remember, running existing projects now gives this error:
Wrong device detected’’
I think this is in Debug Configurations, but I don’t know because apparently it’s not working on this computer (I can’t get the gui editor to show?). These settings are for OpenOCD. Usually I think it’s a text file generated for you. On a work project we override the file manually. Again, if you accidentally changed the processor or board this error would make sense?

Good luck!

Hey thanks for the response!

I actually figured this out 2 weeks ago, but due to the inactivity of this thread I figured that this would just get lost in time, so posting a followup wouldn’t be necessary. Since I fixed my problem, I deleted the original screwy installation of eclipse, so I cannot cross-check your suggestions.

That being said, I’ll still try to address your suggestions. I’ve done this enough times to be confident that I did in fact choose the right board, but yes, the build settings were incorrect. Comparing them to a project built when my setup worked, several settings were different, and some completely missing (if I remember correctly, the “Mcu” and “Board” were nonexistent). The reason why I didn’t mention this in my original post was because this was also under the category of things-that-changed-after-doing-something-I-don’t-remember. Since it ended up getting fixed (and I didn’t specifically remember the original settings), I left it out.

As for the compilation flags, I can’t speak to that. I don’t remember at all. I would assume they’d be wrong since the original build settings weren’t correct in the first place.

As for what I did to fix it, I’m actually not completely sure (lol). I just deleted the .eclipse, .p2, and STM32Cube directories, then uninstalled and reinstalled everything. The only notable difference is my java version. I originally used the 13.0.1 jdk, but this time used jdk 8u241Question. This magically fixed all my problems, including the WinRegistry exceptions. Maybe give that a try?

Brilliant, thanks for the feedback! I think I’m using JDK12 at home, which might explain the problem. I’ll try swapping for JDK8 (and hope I don’t break everything else!) and see if that fixes things.

Okay, after many iterations I now have a working instruction to install the OpenSTM32 tools with “Eclipse for Java”.

NOTE: You will need to know how to add package repositories in Eclipse using the Help->Install New Software dialog. When I say “Install”, it means add the package repository and then install the tools that it finds.

1) Check what version of eclipse is supported by the current OpenSTM tools. I found the information here:
Installing System Workbench for STM32 from EclipseQuestion

2) The STM32 tools seem to require JDK 8. I tested with 10, 12 and 13 with no success. OpenJDK 8 can be downloaded here:
To set it up, I personally use the installer and then ensure the PATH environment variable is properly configured with JDK 8 BEFORE any other JDK paths (I use apt on Linux). You could also download and extract the zip file, then set up the PATH manually. (Note, this does not affect the java workspace or project settings, just the version that Eclipse is using).

This bears repeating: Ensure your PATH is correctly set to have JDK 8 first.

3) (Optional) I install the C Development Tools (CDT) manually. This is not necessary from what I can tell, but it gives more control over the tools (and I install the C Toolbar). The correct repository for your version of Eclipse can be found here: https://www.eclipse.org/cdt/downloads.phpQuestion

4) Install the OpenSTM32 tools. I have been using the eclipse addon repository here: http://www.ac6-tools.com/Eclipse-updates/org.openstm32.system-workbench.update-site-v2/Question

That will give you a clean Eclipse install that can be used with Java and C/C++.

Good Luck!

Hi, I ran into this again today. Fortunately I reread these posts and realized what I had done.

A week or two ago I reordered my path so my JDK13 was above 8. I’ve had eclipse open since then but I restarted this morning and it gave that cryptic exception.

This time, I didn’t want to change my path again so I did something else. Here’s what worked for me.

Find where your eclipse.exe is. In the same directory, edit your eclipse.ini

Add the following TWO lines after editing to match your actual Java 8 path:

C:\Program Files\Java\jdk1.8.0_91\bin\javaw.exe

Make sure those are above the -vmargs line in the file. Apparently spaces are not a problem.

When eclipse boots, it will now use your JDK 8, instead of whatever is setup in your path.