Skip to content

Added Cortex-M52 (Armv8.1-M) port - #519

Merged
fdesbiens merged 3 commits into
eclipse-threadx:devfrom
cpussw01:feature/add-cortex-m52-port
Aug 16, 2026
Merged

Added Cortex-M52 (Armv8.1-M) port#519
fdesbiens merged 3 commits into
eclipse-threadx:devfrom
cpussw01:feature/add-cortex-m52-port

Conversation

@cpussw01

@cpussw01 cpussw01 commented Apr 2, 2026

Copy link
Copy Markdown

Fix #518
Add ThreadX port for Cortex-M52, supporting three toolchains:

  • GNU (GCC)
  • AC6 (Arm Compiler 6)
  • IAR

Cortex-M52 is an Armv8.1-M Mainline processor sharing the same architecture profile as Cortex-M55 and Cortex-M85. The port is functionally identical to the existing Cortex-M85 port.

PR checklist

  • Updated function header with a short description and version number
  • Added test case for bug fix or new feature
  • Validated on real hardware

@fdesbiens

Copy link
Copy Markdown
Contributor

Hi @cpussw01.

Thank you for this contribution! Before we can accept it, you need to sign the Eclipse Contributor Agreement (ECA). The purpose of the ECA is to provide a written record that you have agreed to provide your code and documentation contributions under the licenses used by the Eclipse ThreadX project. It also makes it clear that you are promising that what you are contributing to Eclipse is code you wrote, and you have the necessary rights to contribute it to our projects. And finally, it documents a commitment from you that your open source contributions will be permanently on the public record.

Signing the ECA requires an Eclipse Foundation account if you do not already have one. You can create one for free at https://accounts.eclipse.org.

Be sure to use the same email address when you register for the account that you intend to use on Git commit records. Also, please add your GitHub ID to your Eclipse account. This enables synchronisation between Eclipse-owned infrastructure and GitHub.

Here is the link to sign the ECA:
https://accounts.eclipse.org/user/login?destination=user/eca

@cpussw01

cpussw01 commented Apr 7, 2026

Copy link
Copy Markdown
Author

Hi @cpussw01.

Thank you for this contribution! Before we can accept it, you need to sign the Eclipse Contributor Agreement (ECA). The purpose of the ECA is to provide a written record that you have agreed to provide your code and documentation contributions under the licenses used by the Eclipse ThreadX project. It also makes it clear that you are promising that what you are contributing to Eclipse is code you wrote, and you have the necessary rights to contribute it to our projects. And finally, it documents a commitment from you that your open source contributions will be permanently on the public record.

Signing the ECA requires an Eclipse Foundation account if you do not already have one. You can create one for free at https://accounts.eclipse.org.

Be sure to use the same email address when you register for the account that you intend to use on Git commit records. Also, please add your GitHub ID to your Eclipse account. This enables synchronisation between Eclipse-owned infrastructure and GitHub.

Here is the link to sign the ECA: https://accounts.eclipse.org/user/login?destination=user/eca

Hi @fdesbiens
I have signed the ECA , and my github account @cpussw01 has been linked to this ECA account.
Now, this code contribution work can go on forward.
Thank you.

@fdesbiens

Copy link
Copy Markdown
Contributor

Hi @cpussw01. Thank you. The ECA check now passes.

I will ask a team member to review.

@fdesbiens fdesbiens moved this to In review in ThreadX Roadmap Apr 7, 2026
@rahmanih

Copy link
Copy Markdown
Contributor

Hi @cpussw01
welcome to the eclipse threadx world 🎉🎉.

Cortex-M52 is an Armv8.1-M Mainline processor sharing the same architecture profile as Cortex-M55 and Cortex-M85. The port is functionally identical to the existing Cortex-M85 port.

indeed, the Cortex-M52 is identical to the Cortex-M85.

would it possible for you to update the script below by adding cortex_m52 then run it to copy the ARMv8.1-M files in the destination folders.

target_mcu="cortex_m33 cortex_m55 cortex_m85"

PS: I'm assuming you have tested the commit on a real hardware.

regards
haithem.

@JidongMei

Copy link
Copy Markdown

Hi @cpussw01 welcome to the eclipse threadx world 🎉🎉.

Cortex-M52 is an Armv8.1-M Mainline processor sharing the same architecture profile as Cortex-M55 and Cortex-M85. The port is functionally identical to the existing Cortex-M85 port.

indeed, the Cortex-M52 is identical to the Cortex-M85.

would it possible for you to update the script below by adding cortex_m52 then run it to copy the ARMv8.1-M files in the destination folders.

target_mcu="cortex_m33 cortex_m55 cortex_m85"

PS: I'm assuming you have tested the commit on a real hardware.

regards haithem.

Hi haithem
I have updated copy_armv8_m.sh, and using it to update the cortex_m52 port content.
Sure, the cortex_m52 port has been tested on a real Cortex-M52 hardware.
B,R

@fdesbiens fdesbiens self-assigned this Apr 13, 2026
@fdesbiens fdesbiens added this to the 2026-02 milestone Apr 14, 2026
@cpussw01

Copy link
Copy Markdown
Author

Hi @fdesbiens

Since it comes to the end of 2026.06, which might be the end of 2026-02 KM.
Is there anythings that blokcs this PR? or anythings i can do for help.

Thank you.

@fdesbiens
fdesbiens changed the base branch from master to dev August 15, 2026 21:53
cpussw01 and others added 3 commits August 15, 2026 17:53
Add ThreadX port for Cortex-M52, supporting three toolchains:
- GNU (GCC)
- AC6 (Arm Compiler 6)
- IAR

Cortex-M52 is an Armv8.1-M Mainline processor sharing the same
architecture profile as Cortex-M55 and Cortex-M85. The port is
functionally identical to the existing Cortex-M85 port.
-Add cortex_m52 in threadx/scriprts/copy_armv8m.sh
-Using updated copy_armv8m.sh to generate new cortex_m52 port content
The port was generated from ports_arch/ARMv8-M as it stood on master, which has
since moved on. Rebasing onto dev and running scripts/copy_armv8_m.sh again
brings the twelve stale files into line, which is the point of generating them:
the core picks up every ARMv8-M fix made since without anyone porting it by hand.

Among what it picks up: "MOV r0, 0" becomes "MOV r0, #0" in the schedule and
system-return paths, the non-canonical immediate form that GNU as tolerates and
LLVM's assembler rejects; and gnu/src/tx_initialize_low_level.S goes away, since
the shared source no longer has it.

Two integration points exist only on dev, so the original change could not have
included them.

cmake/cortex_m52.cmake, so the port can be selected the documented way. Every
other Cortex-M core has one. It uses the hard float ABI, as Cortex-M55 and
Cortex-M85 do.

An entry in scripts/check_clang.sh, likewise with -mfloat-abi=hard. That flag is
not decoration: -mcpu=cortex-m52 implies Helium, and building it soft-float ends
in "multilib configuration error: No library available for MVE with soft-float
ABI" on every file, which reads as a broken port rather than a missing flag.

Verified after regenerating: scripts/copy_armv8_m.sh is a no-op, so the tree
matches its source; all 14 assembly sources and 188 C sources compile for
cortex-m52 with Arm Toolchain for Embedded 22.1.0.

Note for anyone building with GNU tools: arm-none-eabi-gcc 13.2.1 rejects
-mcpu=cortex-m52 outright. Support arrives in GCC 14.

Assisted-by: Claude Code (Opus 5) <noreply@anthropic.com>
@fdesbiens
fdesbiens force-pushed the feature/add-cortex-m52-port branch from 2748ccd to c05953b Compare August 15, 2026 21:59
@fdesbiens

Copy link
Copy Markdown
Contributor

Thank you for this, and for doing it the right way round.

The thing I most wanted to check was whether the 63 port files were hand-copied. They are not: the substantive change is one word in scripts/copy_armv8_m.sh, and checking out the branch and re-running the generator produced no diff at all. That means Cortex-M52 will pick up every future Armv8-M fix without anyone porting it by hand, which is the property Cortex-A34 and Cortex-A78 lacked until recently. I also confirmed the output is identical to the Cortex-M85 port modulo the core name, across all three toolchains.

I have retargeted this from master to dev and pushed three things to your branch.

Rebased onto dev, then regenerated. This turned out to matter more than a formality. ports_arch/ARMv8-M has moved since you branched, so regenerating changed twelve files — the port as committed was generated from the older shared source. Among what it picks up: MOV r0, 0 becomes MOV r0, #0 in the schedule and system-return paths, which is the non-canonical immediate form GNU as tolerates and LLVM's assembler rejects; and gnu/src/tx_initialize_low_level.S disappears, because the shared source no longer has it. Nothing for you to do — it is exactly the benefit of generating the port.

Added cmake/cortex_m52.cmake. Every other Cortex-M core has one on dev, and without it the port cannot be selected the documented way. It could not have been in your original change, since those files did not exist on master.

Added a PORT_TARGET entry to scripts/check_clang.sh, so the port is covered by the LLVM assembly check.

Two details worth recording, because both look like a broken port if you meet them cold.

The float ABI is load bearing. -mcpu=cortex-m52 implies Helium, and building soft-float fails on every file with multilib configuration error: No library available for MVE with soft-float ABI. Cortex-M55 and Cortex-M85 already carry -mfloat-abi=hard for the same reason, and the new files do too.

The compiler has to know the core. arm-none-eabi-gcc only learned -mcpu=cortex-m52 in GCC 14; 13.x rejects it outright, and 13.x is what several distributions still ship. The toolchain file therefore pins the project's reference toolchain the way cmake/cortex_r52.cmake does, with an ARM_TOOLCHAIN_PATH override and a guard that falls back to PATH when the pinned directory is absent.

Verified after the changes: scripts/copy_armv8_m.sh is a no-op, so the tree matches its source; scripts/check_ports.sh passes; scripts/check_clang.sh passes with the new core included, 724 of 724 assembly sources and nothing skipped; and the port builds through CMake with Arm GNU Toolchain 14.3.Rel1, producing a 281 KB libthreadx.a. It also compiles cleanly with Arm Toolchain for Embedded 22.1.0.

Still unchecked on the PR is hardware validation. For a port generated from a validated shared source that carries less weight than it would for hand-written assembly, but it is worth saying plainly that nobody has run this on silicon.

@fdesbiens fdesbiens changed the title ports: add Cortex-M52 (Armv8.1-M) port support Added Cortex-M52 (Armv8.1-M) port Aug 16, 2026
@fdesbiens
fdesbiens merged commit 090f8ed into eclipse-threadx:dev Aug 16, 2026
4 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in ThreadX Roadmap Aug 16, 2026
fdesbiens added a commit to fdesbiens/threadx-fd that referenced this pull request Aug 16, 2026
Every Armv8-M port readme ends with

    09-30-2020  Initial ThreadX 6.1 version for Cortex-M85 using GNU tools.

with the core name substituted in by scripts/copy_armv8_m.sh. The date is the
shared port's, so each core inherits it whatever its own history: Cortex-M85 was
announced in 2022 and its readme claims a 2020 origin, and any core added later
gets the same treatment the moment its name joins the generator's list.

The rest of the history block is accurate, since it records changes to the shared
files. Only the closing line asserts something per-core. Reword it to describe
the Armv8-M port itself, and say where a given core's real starting point is.

Regenerating updates the twelve readmes for cortex_m33, cortex_m52, cortex_m55
and cortex_m85 across the three toolchains.

Cortex-M52 makes the point: it arrived in eclipse-threadx#519 and its readme immediately claimed
a 2020 origin for a core announced in 2023.

The ARMv7-M templates say "Initial ThreadX version 6.1.7 for Cortex-M", with no
placeholder to substitute, so they make no per-core claim and are left alone.

Assisted-by: Claude Code (Opus 5) <noreply@anthropic.com>
fdesbiens added a commit that referenced this pull request Aug 16, 2026
)

Every Armv8-M port readme ends with

    09-30-2020  Initial ThreadX 6.1 version for Cortex-M85 using GNU tools.

with the core name substituted in by scripts/copy_armv8_m.sh. The date is the
shared port's, so each core inherits it whatever its own history: Cortex-M85 was
announced in 2022 and its readme claims a 2020 origin, and any core added later
gets the same treatment the moment its name joins the generator's list.

The rest of the history block is accurate, since it records changes to the shared
files. Only the closing line asserts something per-core. Reword it to describe
the Armv8-M port itself, and say where a given core's real starting point is.

Regenerating updates the twelve readmes for cortex_m33, cortex_m52, cortex_m55
and cortex_m85 across the three toolchains.

Cortex-M52 makes the point: it arrived in #519 and its readme immediately claimed
a 2020 origin for a core announced in 2023.

The ARMv7-M templates say "Initial ThreadX version 6.1.7 for Cortex-M", with no
placeholder to substitute, so they make no per-core claim and are left alone.

Assisted-by: Claude Code (Opus 5) <noreply@anthropic.com>
akifejaz pushed a commit to akifejaz/threadx that referenced this pull request Aug 17, 2026
* ports: add Cortex-M52 (Armv8.1-M) port support

Add ThreadX port for Cortex-M52, supporting three toolchains:
- GNU (GCC)
- AC6 (Arm Compiler 6)
- IAR

Cortex-M52 is an Armv8.1-M Mainline processor sharing the same
architecture profile as Cortex-M55 and Cortex-M85. The port is
functionally identical to the existing Cortex-M85 port.

* ports: update cortex_m52 port copy script,using it update content

-Add cortex_m52 in threadx/scriprts/copy_armv8m.sh
-Using updated copy_armv8m.sh to generate new cortex_m52 port content

* Regenerated the Cortex-M52 port against dev and wired it into the checks

The port was generated from ports_arch/ARMv8-M as it stood on master, which has
since moved on. Rebasing onto dev and running scripts/copy_armv8_m.sh again
brings the twelve stale files into line, which is the point of generating them:
the core picks up every ARMv8-M fix made since without anyone porting it by hand.

Among what it picks up: "MOV r0, 0" becomes "MOV r0, #0" in the schedule and
system-return paths, the non-canonical immediate form that GNU as tolerates and
LLVM's assembler rejects; and gnu/src/tx_initialize_low_level.S goes away, since
the shared source no longer has it.

Two integration points exist only on dev, so the original change could not have
included them.

cmake/cortex_m52.cmake, so the port can be selected the documented way. Every
other Cortex-M core has one. It uses the hard float ABI, as Cortex-M55 and
Cortex-M85 do.

An entry in scripts/check_clang.sh, likewise with -mfloat-abi=hard. That flag is
not decoration: -mcpu=cortex-m52 implies Helium, and building it soft-float ends
in "multilib configuration error: No library available for MVE with soft-float
ABI" on every file, which reads as a broken port rather than a missing flag.

Verified after regenerating: scripts/copy_armv8_m.sh is a no-op, so the tree
matches its source; all 14 assembly sources and 188 C sources compile for
cortex-m52 with Arm Toolchain for Embedded 22.1.0.

Note for anyone building with GNU tools: arm-none-eabi-gcc 13.2.1 rejects
-mcpu=cortex-m52 outright. Support arrives in GCC 14.

---------

Co-authored-by: Frédéric Desbiens <frederic.desbiens@eclipse-foundation.org>
Assisted-by: Claude Code (Opus 5) <noreply@anthropic.com>
akifejaz pushed a commit to akifejaz/threadx that referenced this pull request Aug 17, 2026
…clipse-threadx#623)

Every Armv8-M port readme ends with

    09-30-2020  Initial ThreadX 6.1 version for Cortex-M85 using GNU tools.

with the core name substituted in by scripts/copy_armv8_m.sh. The date is the
shared port's, so each core inherits it whatever its own history: Cortex-M85 was
announced in 2022 and its readme claims a 2020 origin, and any core added later
gets the same treatment the moment its name joins the generator's list.

The rest of the history block is accurate, since it records changes to the shared
files. Only the closing line asserts something per-core. Reword it to describe
the Armv8-M port itself, and say where a given core's real starting point is.

Regenerating updates the twelve readmes for cortex_m33, cortex_m52, cortex_m55
and cortex_m85 across the three toolchains.

Cortex-M52 makes the point: it arrived in eclipse-threadx#519 and its readme immediately claimed
a 2020 origin for a core announced in 2023.

The ARMv7-M templates say "Initial ThreadX version 6.1.7 for Cortex-M", with no
placeholder to substitute, so they make no per-core claim and are left alone.

Assisted-by: Claude Code (Opus 5) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Adding Cortex-M52 port support

4 participants