Author Topic: ARM Cortex-M implementations  (Read 1953 times)

0 Members and 1 Guest are viewing this topic.

Offline UnixonTopic starter

  • Frequent Contributor
  • **
  • Posts: 762
ARM Cortex-M implementations
« on: September 07, 2026, 08:55:49 pm »
Every time I see a new ARM MCU from a previously unknown manufacturer I have exactly the same question on my mind: how compatible is this one with other ARM MCUs with the same core?
What parts could possibly change and what parts could not? Would I be able to make a firmware for that new MCU and program it or not?
Well, the ISA is definitely not changing, OK, but ABI can change and I saw Chinese clones doing exactly that - shuffling bits around.
What about memory map? How badly could it be mixed up? Peripherals - definitely could be different and differently mapped.
What part about ARM (or any other architecture) could we trust at all to stay exactly the same across different implementations?
 

Offline langwadt

  • Super Contributor
  • ***
  • Posts: 5783
  • Country: dk
Re: ARM Cortex-M implementations
« Reply #1 on: September 07, 2026, 10:16:48 pm »
Every time I see a new ARM MCU from a previously unknown manufacturer I have exactly the same question on my mind: how compatible is this one with other ARM MCUs with the same core?
What parts could possibly change and what parts could not? Would I be able to make a firmware for that new MCU and program it or not?
Well, the ISA is definitely not changing, OK, but ABI can change and I saw Chinese clones doing exactly that - shuffling bits around.
What about memory map? How badly could it be mixed up? Peripherals - definitely could be different and differently mapped.
What part about ARM (or any other architecture) could we trust at all to stay exactly the same across different implementations?

instructionset, nvic, systick, debug core, should be the same. the rest vendor specific
 
The following users thanked this post: Unixon

Offline gf

  • Super Contributor
  • ***
  • Posts: 1831
  • Country: de
Re: ARM Cortex-M implementations
« Reply #2 on: September 07, 2026, 10:44:08 pm »
The following documents apply universally to each silicon vendor:

Arm Architecture Reference Manual for the specific architecture version (e.g., ARMv7-M)
Arm Technical Reference Manual for the specific processor (e.g., Cortex-M4)

The Arm Architecture Reference Manual outlines all possible capabilities for the ARMv7-M generation, but the Cortex-M4 TRM dictates the physical implementation rules, distinguishing between mandatory requirements and configurable options. Because optional features (such as the FPU or MPU) are implemented at the vendor's discretion, you can strictly rely only on the core mandatory features guaranteed by the TRM if you want to ensure absolute software portability across all Cortex-M4 vendors. The vendor's reference manual (or datasheet) is supposed to specify which of these options are actually implemented.

While the HAL provides a uniform software interface, it cannot instantiate absent hardware; you still cannot access optional features like the MPU if the vendor chose to omit them.
 
The following users thanked this post: Unixon

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4655
  • Country: us
Re: ARM Cortex-M implementations
« Reply #3 on: September 08, 2026, 05:59:30 am »
There are "optional" features for each core.  It's nice if the vendor's datasheet provides and explicit callout in the datasheet of what they've actually implemented (SAMD21 From Atmel/Microchip example):
Quote
but ABI can change and I saw Chinese clones doing exactly that - shuffling bits around.
I'm not sure what you mean by that.  The "ABI" is normally a software thing, not dependent on the "core."

 

Offline UnixonTopic starter

  • Frequent Contributor
  • **
  • Posts: 762
Re: ARM Cortex-M implementations
« Reply #4 on: September 08, 2026, 10:57:08 am »
I'm not sure what you mean by that.  The "ABI" is normally a software thing, not dependent on the "core."
I believe someone mentioned it on the forum recently that they have encountered a Chinese ARM MCU clone fully implemented architecturally but binary incompatible because of swapped bit fields in instruction codes and other obfuscation. However, those Chinese guys were not claiming that still being an ARM to avoid license payments to ARM Holdings.
 

Offline UnixonTopic starter

  • Frequent Contributor
  • **
  • Posts: 762
Re: ARM Cortex-M implementations
« Reply #5 on: September 08, 2026, 08:31:23 pm »
Considering features that are either mandatory or optional, what is exactly defined about them? Control register layout? Memory mapping of control registers?
Haven't read RMs yet...
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3526
  • Country: ca
Re: ARM Cortex-M implementations
« Reply #6 on: September 08, 2026, 09:20:50 pm »
Considering features that are either mandatory or optional, what is exactly defined about them? Control register layout? Memory mapping of control registers?
Haven't read RMs yet...

There are registers which let you see if a particular optional feature is included, cannot tell about all features though. Usually you don't need to worry about these except for major things such as FPU.

Some of registers come with the core. Major memory areas are determined by the core, but not details. It's all in RM.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->