Skip to content

!arch/stm32: split stm32 and stm32f0l0g0 into per-chip-family directories#19143

Merged
acassis merged 16 commits into
apache:masterfrom
raiden00pl:stm32_refactor_all_pr8
Jun 24, 2026
Merged

!arch/stm32: split stm32 and stm32f0l0g0 into per-chip-family directories#19143
acassis merged 16 commits into
apache:masterfrom
raiden00pl:stm32_refactor_all_pr8

Conversation

@raiden00pl

Copy link
Copy Markdown
Member

Summary

This PR moves the shared arch/arm/src/stm32 and arch/arm/src/stm32f0l0g0 arch and board code into common/stm32 directories and splits the two historical super-directories into one directory per chip family.

Most of the changes in the PR involve moving files and using "git mv" to preserve git history. The size of this PR is quite large, but it can't be broken down into smaller pieces without breaking CI.

I also added a page in the documentation summarizing the stm32 ports standardization with migration guide.

Reference: #19004

Fixes #16172 and #18894

Impact

BREAKING CHANGE: Each STM32 family now has a separate directory in the arch. arch/arm/src/stm32 was divided into:

  • arch/arm/src/stm32l1
  • arch/arm/src/stm32f1
  • arch/arm/src/stm32f2
  • arch/arm/src/stm32f3
  • arch/arm/src/stm32f4
  • arch/arm/src/stm32g4

arch/arm/src/stm32f0l0g0 was divided into:

  • arch/arm/src/stm32c0
  • arch/arm/src/stm32g0
  • arch/arm/src/stm32l0
  • arch/arm/src/stm32f0

The common code that was used by the families was moved to arch/arm/src/common/stm32.

For boards, common STM32 board code was introduced in boards/arm/common/stm32. It can now we shared for all STM32 families and board code can be reused. Migration of the rest STM32 families to board common will be done later.

Testing

CI

@github-actions github-actions Bot added Area: Build system Arch: arm Issues related to ARM (32-bit) architecture Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces. Board: arm labels Jun 15, 2026
@raiden00pl
raiden00pl requested a review from jerpelea June 17, 2026 09:15
BREAKING CHANGE: Move the existing STM32 board common sources to
boards/arm/common/stm32 and fold in the common STM32F0/L0/G0/C0
board helpers so split STM32 board families can share one source
tree.

Signed-off-by: raiden00pl <raiden00@railab.me>
Add boards/arm/stm32l4/common so STM32L4 boards build through the shared
STM32 board-common tree (boards/arm/common/stm32), like the other split
STM32 families.

Convert each STM32L4 board's src/Makefile to src/Make.defs so the
per-board sources are pulled in by the common board Makefile.

Signed-off-by: raiden00pl <raiden00@railab.me>
BREAKING CHANGE: Common STM32 source and private header files moved to
arch/arm/src/common/stm32. Out-of-tree code that references family-local
common source paths must update includes, build rules, and source paths
to the new common STM32 location.

Signed-off-by: raiden00pl <raiden00@railab.me>
BREAKING CHANGE:

Part of splitting the legacy stm32 super-directory; relocates
the stm32f0 sources, headers and boards into arch/arm/src/stm32f0,
arch/arm/include/stm32f0 and boards/arm/stm32f0.

Signed-off-by: raiden00pl <raiden00@railab.me>
BREAKING CHANGE:

Part of splitting the legacy stm32 super-directory; relocates
the stm32l0 sources, headers and boards into arch/arm/src/stm32l0,
arch/arm/include/stm32l0 and boards/arm/stm32l0.

Signed-off-by: raiden00pl <raiden00@railab.me>
BREAKING CHANGE:

Part of splitting the legacy stm32 super-directory; relocates
the stm32g0 sources, headers and boards into arch/arm/src/stm32g0,
arch/arm/include/stm32g0 and boards/arm/stm32g0.

Signed-off-by: raiden00pl <raiden00@railab.me>
Move the stm32c0 sources, headers and boards into arch/arm/src/stm32c0,
arch/arm/include/stm32c0 and boards/arm/stm32c0, then finalize the split:
source each split family directly in arch/arm/Kconfig and boards/Kconfig and
remove the now-empty combined arch/arm/src/stm32f0l0g0 and
boards/arm/stm32f0l0g0 trees.

BREAKING CHANGE: The combined STM32F0/L0/G0/C0 architecture and board
paths were split into stm32f0, stm32l0, stm32g0, and stm32c0 directories.
Out-of-tree boards, include paths, source paths, and defconfigs must move
from stm32f0l0g0 to the matching split family.

Signed-off-by: raiden00pl <raiden00@railab.me>
BREAKING CHANGE:

Part of splitting the legacy stm32 super-directory; relocates
the stm32f1 sources, headers and boards into arch/arm/src/stm32f1,
arch/arm/include/stm32f1 and boards/arm/stm32f1.

Signed-off-by: raiden00pl <raiden00@railab.me>
BREAKING CHANGE:

Part of splitting the legacy stm32 super-directory; relocates
the stm32f2 sources, headers and boards into arch/arm/src/stm32f2,
arch/arm/include/stm32f2 and boards/arm/stm32f2.

Signed-off-by: raiden00pl <raiden00@railab.me>
BREAKING CHANGE:

Part of splitting the legacy stm32 super-directory; relocates
the stm32f3 sources, headers and boards into arch/arm/src/stm32f3,
arch/arm/include/stm32f3 and boards/arm/stm32f3.

Signed-off-by: raiden00pl <raiden00@railab.me>
BREAKING CHANGE:

Part of splitting the legacy stm32 super-directory; relocates
the stm32f4 sources, headers and boards into arch/arm/src/stm32f4,
arch/arm/include/stm32f4 and boards/arm/stm32f4.

Signed-off-by: raiden00pl <raiden00@railab.me>
BREAKING CHANGE:

Part of splitting the legacy stm32 super-directory; relocates
the stm32g4 sources, headers and boards into arch/arm/src/stm32g4,
arch/arm/include/stm32g4 and boards/arm/stm32g4.

Signed-off-by: raiden00pl <raiden00@railab.me>
Move the stm32l1 sources, headers and boards into arch/arm/src/stm32l1,
arch/arm/include/stm32l1 and boards/arm/stm32l1, then finalize the split:
source each split family directly in arch/arm/Kconfig and boards/Kconfig and
remove the now-empty combined arch/arm/src/stm32 and boards/arm/stm32 trees.

BREAKING CHANGE: The legacy STM32 architecture and board paths were split into
stm32f1, stm32l1, stm32f2, stm32f3, stm32f4, and stm32g4 directories.
Out-of-tree boards must move from stm32 to the matching split family.

Signed-off-by: raiden00pl <raiden00@railab.me>
fix various stm32 boards errors found by CI

Signed-off-by: raiden00pl <raiden00@railab.me>
update arm-13.dat build targets so they match state before stm32 split

Signed-off-by: raiden00pl <raiden00@railab.me>
add STM32 porting guide

Signed-off-by: raiden00pl <raiden00@railab.me>
@xiaoxiang781216

Copy link
Copy Markdown
Contributor

@jerpelea @acassis please merge this patch

@acassis
acassis merged commit 8b7639d into apache:master Jun 24, 2026
47 of 56 checks passed
@acassis

acassis commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

@raiden00pl please take a look:

image

Seems like the linker file for a board is missing

@raiden00pl

Copy link
Copy Markdown
Member Author

I'm AFK this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: arm Issues related to ARM (32-bit) architecture Area: Build system Board: arm Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The naming for stm32f0l0g0 architecture is no longer valid

5 participants