Skip to content

fix(stm32): improve QEMU and macOS build support - #1

Merged
stephen-zeng merged 1 commit into
stm32from
stm32-follow-up
Jul 15, 2026
Merged

fix(stm32): improve QEMU and macOS build support#1
stephen-zeng merged 1 commit into
stm32from
stm32-follow-up

Conversation

@stephen-zeng

Copy link
Copy Markdown
Collaborator

Summary

  • isolate STM32 QEMU builds and skip unsupported board peripherals during emulation
  • auto-detect both riscv64-unknown-elf- and riscv64-elf- toolchains
  • support macOS QEMU display and Homebrew mkfs.ext4 paths
  • declare all tracked external repositories as submodules
  • remove incomplete build artifacts after failed recipes

Verification

  • make ARCH=armv7m BOARD=stm32f103 PROFILE=mcu STM32_FLASH_KB=128 STM32_RAM_KB=8 STM32_QEMU=1 kernel-only
  • make stm32f103-bringup
  • QEMU stm32vldiscovery smoke test produced boot output and four consecutive one-second ticks
  • make ARCH=riscv64 native-minimal-rv using riscv64-elf-gcc

Copilot AI review requested due to automatic review settings July 15, 2026 13:36
@stephen-zeng
stephen-zeng merged commit a54d6c6 into stm32 Jul 15, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves cross-platform build and emulation ergonomics, focusing on STM32 bringup under QEMU and better host/toolchain autodetection (notably for macOS and RISC-V ELF toolchains).

Changes:

  • Isolates STM32 QEMU builds via a dedicated STM32_QEMU flag, and skips unsupported STM32 peripheral init/service in emulation.
  • Auto-detects riscv64-unknown-elf- vs riscv64-elf- toolchain prefixes across top-level and user builds.
  • Improves macOS support by selecting -display cocoa for QEMU GUI runs and adding Homebrew mkfs.ext4 search paths; adds external repos to .gitmodules and enables .DELETE_ON_ERROR.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
user/Makefile Auto-detects a RISC-V ELF toolchain prefix and reuses it for rv64/rv32 user builds.
user/extra.mk Mirrors the user toolchain prefix autodetection for “extra” package builds.
Makefile Adds STM32_QEMU support, macOS QEMU GUI display selection, Homebrew mkfs.ext4 paths, .DELETE_ON_ERROR, and updates RISC-V native compiler selection.
kernel/mcu/main.c Skips STM32 peripheral init/service under QEMU and adds periodic tick logging.
.gitmodules Declares additional tracked external repositories as submodules.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread kernel/mcu/main.c
Comment on lines +221 to +224
if (now - last_tick_report >= 1000U) {
last_tick_report = now;
printf("[TICK] %lu ms\n", (unsigned long)now);
}
@fQwQf
fQwQf deleted the stm32-follow-up branch July 18, 2026 12:44
fQwQf pushed a commit that referenced this pull request Jul 18, 2026
fix(stm32): improve QEMU and macOS build support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants