Setup STM32 Dev Environment on Windows Laptop with Virtual Machine

Software Spec

Host OS: Windows 11 Pro 24H2

VMware Workstation 17 Pro (17.5.2 build-23775571)

Guest OS: Ubuntu 24.04 LTS, Debian 12 (Failed), Debian 13(Failed)

1. Setup Guest OS

First, I found no Internet in the guest OS, need to manually turn on the related service on the Windows host.

I had problems with open-vm-tools on Debian 12. The auto resolution, and the sharing folder features does not work. Try to manual install the VMWare tool with inserting ISO, resulted in segment fault when compiling.

Tried same approach with Debian 13 released few days ago, does not work.

Try to install Ubuntu 24 LTS as the guest OS instead. VMWare detected the OS, will use the easy install. open-vm-tools and other features are automatically set up.

2. Setup the Cross Compile Toolchain

Update the system first.

1
apt update && apt upgrade

Install the required packages.

1
apt install vim p7zip-full git make cmake stlink-tools minicom

Download and extract the cross-compile toolchain to the ~/opt/ folder.

1
2
3
4
5
mkdir -p ~/opt && cd ~/opt

wget https://developer.arm.com/-/media/Files/downloads/gnu/14.2.rel1/binrel/arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabi.tar.xz

tar xvf arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabi.tar.xz

As for the meaning of the suffix arm-none-eabi: ARM is the target architecture, none means no vender, EABI stands for Embedded Application Binary Interface.

Add the path environment to the ~/.bashrc

1
export PATH=$PATH:/home/alice/opt/arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabi/bin

Update the environment and verify the installation is successful by printing the version.

1
source ~/.bashrc

3. Setup the Serial Port in the Guest OS

Plug in the STM32 board and link that to the guest OS
![[/images/Setup STM32 Dev Environment on Windows Laptop with Virtual Machine-res/setup_usb_reflex.png]]
The drive file should show up in the /dev device mapping folder as /dev/ACM0

Related read: What is the difference between /dev/ttyUSB and /dev/ttyACM?

4. Setup the STM32CubeIDE

After installed the IDE in the ~/opt folder. Launch the IDE.

I have a 3k high resolution screen on my laptop. And the IDE’s font does not auto-scale with the OS settings.

Go to the Window -> Display Size -> Large to manual change the font setting.

Another bug appears. Some characters become invisible.

Which is solved by disable 3D acceleration

5. Try to Compile

Update the CMake file generated by the STM32CubeIDE

1
2
3
4
5
# Setup compiler settings
set(CMAKE_C_COMPILER /home/alice/opt/arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-gcc)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS ON)

Try to compile with the following commands

1
2
3
4
mkdir -p build
cd build
cmake ../
make

Compile failed

To Be Continued…

Reference

https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html

Setup STM32 Dev Environment on Windows Laptop with Virtual Machine

http://example.com/2025/09/13/Setup-STM32-Dev-Environment-on-Windows-Laptop-with-Virtual-Machine/

Author

Simon C.

Posted on

2025-09-13

Updated on

2025-09-13

Licensed under