STM32 Project Won't Build Due To Path Issue

I'm using the Windows 64 bit portable version of Arduino IDE 2.0 to build an STM32 project (working fine in v1.8.3), which fails with the following error:

Compilation error: exec: "C:\Users\Me\AppData\Local\Arduino15\packages\STMicroelectronics\tools\STM32Tools\2.1.0/tools/win/busybox.exe": file does not exist

This path looks invalid due to the forward slashes, and there's no 2.1.0\tools folder anyway.

Hi @spcplugins. Thanks for giving the Arduino IDE 2.0.0 release candidate a try!

Even though it looks strange, this is a perfectly valid path, and is expected. In addition to the annoying native backslash (\), Windows also supports the slash (/) path separator used by Linux and macOS.

The command you see is built from a template:

https://github.com/stm32duino/Arduino_Core_STM32/blob/2.2.0/platform.txt#L116

recipe.hooks.prebuild.1.pattern.windows="{runtime.tools.STM32Tools.path}/win/busybox.exe" sh "{extras.path}/prebuild.sh" "{build.path}" "{build.source.path}"

The {runtime.tools.STM32Tools.path} part is automatically generated by the operating system, so it uses the native \, but there are also hardcoded path separators in the rest of the template, which is the source of the / that gave you confusion.

Is there anything in this folder?

C:\Users\Me\AppData\Local\Arduino15\packages\STMicroelectronics\tools\STM32Tools

Thank you for your assistance.

There's "2.1.0\win\busybox.exe"

But there's no "2.1.0\tools\"

This was a bug in the older versions of the STM32duino boards platform.

It was fixed last year:

So you only need to update to using the modern version of the boards platform and the error will no longer occur.

I'll provide instructions:

  1. Select File > Preferences... from the Arduino IDE menus.
  2. If it is not already present, add this URL:
    https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json
    
    If you have other URLs in the field already, use a comma to separate them. However, if you have some different stm32duino URL, you must remove it and replace it with the current official one I provided.
  3. Click the OK button.
  4. Select File > Quit from the Arduino IDE menus.
  5. Start the Arduino IDE.
  6. If it is not open already, open the "Boards Manager view by selecting Tools > Board > Boards Manager from the Arduino IDE menus.
  7. Find "STM32 MCU based boards by STMicroelectronics" in the list of boards platforms. Click on it.
  8. Make sure "2.2.0" is selected in the version menu.
  9. Click the INSTALL button.
  10. Wait for the update to finish.

Now you can compile and upload to your STM32 board without running into that bug.

Thank you for your detailed instructions. I've got this working fine now, and can build and upload to my board without any problems. The new Arduino IDE is a big improvement. Cheers!

You are welcome. I'm glad it is working now. Enjoy!

Per

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.