STM32

STM32 — macOS Setup

Install STM32CubeIDE on macOS. The process is straightforward — download, install, and connect your NUCLEO board.


Prerequisites

  • macOS 12 Monterey or later (Intel or Apple Silicon with Rosetta 2)
  • A free st.com account
  • At least 4 GB of free disk space

Apple Silicon compatibility note

As of 2025/2026, STM32CubeIDE runs on Apple Silicon Macs via Rosetta 2. If you don't have Rosetta installed, macOS will prompt you to install it when you first launch CubeIDE. This is normal and required.


Step 1 — Install Rosetta 2 (Apple Silicon Only)

If you're on an M1/M2/M3/M4 Mac, install Rosetta 2 first:

shell
softwareupdate --install-rosetta --agree-to-license

Step 2 — Download STM32CubeIDE

  1. Go to st.com/en/development-tools/stm32cubeide.html
  2. Click Get Software and log in with your ST account
  3. Download "STM32CubeIDE-Mac" (the .dmg file)

Step 3 — Install STM32CubeIDE

  1. Open the downloaded .dmg file
  2. Drag STM32CubeIDE to the Applications folder
  3. Eject the disk image

First launch — Gatekeeper bypass:

macOS may block the app because it's not from the App Store:

  1. Go to System Settings → Privacy & Security
  2. Scroll to the bottom — you'll see a message about STM32CubeIDE being blocked
  3. Click "Open Anyway"
  4. Confirm by clicking Open in the popup

Step 4 — Install Java (if needed)

STM32CubeIDE bundles its own JRE. If you see a Java error on first launch:

shell
# Install Temurin JDK via Homebrew as a fallback
brew install --cask temurin

Step 5 — Launch and Configure

  1. Open STM32CubeIDE from Applications
  2. Choose a workspace directory (e.g., /Users/<you>/STM32CubeIDE/workspace)
  3. Click Launch

Step 6 — Connect Your NUCLEO Board

  1. Connect your NUCLEO board via USB
  2. Open System Information (Apple menu → About This Mac → System Report → USB)
  3. Look for "STM32 STLink" — it should appear in the USB device list

In STM32CubeIDE, go to Help → ST-LINK Upgrade — your board's firmware version should appear.


  1. File → New → STM32 Project
  2. In the Board Selector, search for your board (e.g., NUCLEO-F446RE)
  3. Select it and click Next
  4. Name: hello_blink, Language: C
  5. Click Finish — CubeMX opens with the board configuration

Add blink code in Core/Src/main.c inside the while(1) loop:

c
1while (1)
2{
3 HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_5); // Onboard LED (LD2)
4 HAL_Delay(500); // 500ms delay
5}

Build with Cmd+B, then press F11 to flash and debug.


Step 8 — Serial Terminal on macOS

NUCLEO boards appear as a virtual COM port on macOS:

shell
# Find the ST-LINK virtual COM port
ls /dev/cu.*
# Expected: /dev/cu.usbmodem14203 or similar

# Open with screen (built-in)
screen /dev/cu.usbmodem14203 115200

# Exit screen: Ctrl+A then K then Y

Or use the Serial Monitor extension in VS Code.


Troubleshooting

STM32CubeIDE shows "damaged and cannot be opened"

Run this in Terminal to remove the quarantine flag:

shell
xattr -cr /Applications/STM32CubeIDE.app

Then try opening again.

NUCLEO not detected after connecting

  • Check System Information → USB for the device
  • Try a different USB cable (some USB-C hubs have compatibility issues with ST-LINK)
  • Try connecting directly to the Mac's USB-A port or use a powered hub

"Unable to launch the debugger" error

This is usually a permissions issue. Open System Settings → Privacy & Security → Developer Tools and add STM32CubeIDE to the list.


Next Steps

Previous
Ubuntu / Linux Setup