fix(stm32): improve QEMU and macOS build support - #1
Merged
Conversation
There was a problem hiding this comment.
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_QEMUflag, and skips unsupported STM32 peripheral init/service in emulation. - Auto-detects
riscv64-unknown-elf-vsriscv64-elf-toolchain prefixes across top-level and user builds. - Improves macOS support by selecting
-display cocoafor QEMU GUI runs and adding Homebrewmkfs.ext4search paths; adds external repos to.gitmodulesand 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 on lines
+221
to
+224
| if (now - last_tick_report >= 1000U) { | ||
| last_tick_report = now; | ||
| printf("[TICK] %lu ms\n", (unsigned long)now); | ||
| } |
fQwQf
pushed a commit
that referenced
this pull request
Jul 18, 2026
fix(stm32): improve QEMU and macOS build support
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
riscv64-unknown-elf-andriscv64-elf-toolchainsmkfs.ext4pathsVerification
make ARCH=armv7m BOARD=stm32f103 PROFILE=mcu STM32_FLASH_KB=128 STM32_RAM_KB=8 STM32_QEMU=1 kernel-onlymake stm32f103-bringupstm32vldiscoverysmoke test produced boot output and four consecutive one-second ticksmake ARCH=riscv64 native-minimal-rvusingriscv64-elf-gcc