Author Topic: Are the common ARM peripherals standardized and code compatible?  (Read 3240 times)

0 Members and 1 Guest are viewing this topic.

Offline RoGeorgeTopic starter

  • Super Contributor
  • ***
  • Posts: 7365
  • Country: ro
Are the common ARM peripherals standardized and code compatible?
« on: February 18, 2022, 09:51:13 pm »
Is it expected for common peripherals, like an I2C or a timer, to be the same between different manufacturers, just like the ARM core remains the same between manufacturers?

I mean, the instruction set remains the same and compatible along a given ARM core, but is this compatibility similar between the same type of peripherals, do the peripherals share the same code/libraries?

Offline Sal Ammoniac

  • Super Contributor
  • ***
  • Posts: 1772
  • Country: us
Re: Are the common ARM peripherals standardized and code compatible?
« Reply #1 on: February 18, 2022, 10:00:36 pm »
Usually it's just the ARM core that is common among MCU makers. The peripherals are generally different.

Sometimes different manufacturers buy IP for peripherals from the same source, in which case the peripheral will be the same across different manufacturers, but that's fairly rare.
"That's not even wrong" -- Wolfgang Pauli
 
The following users thanked this post: RoGeorge

Offline coppice

  • Super Contributor
  • ***
  • Posts: 10289
  • Country: gb
Re: Are the common ARM peripherals standardized and code compatible?
« Reply #2 on: February 18, 2022, 10:08:18 pm »
Don't expect commonality of peripherals between devices. You may find some peripherals common between devices, because the developers of both devices licenced the peripheral designs from the same third party. Most vendors aren't even very consistent about using the same peripheral design across all the devices in their range.
 
The following users thanked this post: RoGeorge

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4415
  • Country: us
Re: Are the common ARM peripherals standardized and code compatible?
« Reply #3 on: February 18, 2022, 11:41:43 pm »
Quote
Is it expected for common peripherals, like an I2C or a timer, to be the same between different manufacturers
No.  other than the "peripherals" that are considered part of the ARM core (NVIC, Systick, a few others), they vary quite wildly (even between different "families" from the same vendor.)
 
The following users thanked this post: RoGeorge

Online ataradov

  • Super Contributor
  • ***
  • Posts: 12017
  • Country: us
    • Personal site
Re: Are the common ARM peripherals standardized and code compatible?
« Reply #4 on: February 19, 2022, 01:03:47 am »
If peripherals are standardized, then there would be no differentiation between the devices. No vendor will ever go for that. This is part of the reason why software side of the CMSIS failed.
« Last Edit: February 19, 2022, 02:13:03 am by ataradov »
Alex
 

Offline rsjsouza

  • Super Contributor
  • ***
  • Posts: 6148
  • Country: us
  • Eternally curious
    • Vbe - vídeo blog eletrônico
Re: Are the common ARM peripherals standardized and code compatible?
« Reply #5 on: February 19, 2022, 01:40:59 am »
Quote
Is it expected for common peripherals, like an I2C or a timer, to be the same between different manufacturers
No.  other than the "peripherals" that are considered part of the ARM core (NVIC, Systick, a few others), they vary quite wildly (even between different "families" from the same vendor.)
Indeed. And even some of these (such as Systick, ITM, etc.) may even be optional or proprietary depending on the vendor. Arm gives a lot of options on their IP.
Vbe - vídeo blog eletrônico http://videos.vbeletronico.com

Oh, the "whys" of the datasheets... The information is there not to be an axiomatic truth, but instead each speck of data must be slowly inhaled while carefully performing a deep search inside oneself to find the true metaphysical sense...
 

Offline langwadt

  • Super Contributor
  • ***
  • Posts: 5066
  • Country: dk
Re: Are the common ARM peripherals standardized and code compatible?
« Reply #6 on: February 19, 2022, 02:01:40 am »
Quote
Is it expected for common peripherals, like an I2C or a timer, to be the same between different manufacturers
No.  other than the "peripherals" that are considered part of the ARM core (NVIC, Systick, a few others), they vary quite wildly (even between different "families" from the same vendor.)
Indeed. And even some of these (such as Systick, ITM, etc.) may even be optional or proprietary depending on the vendor. Arm gives a lot of options on their IP.

sure, but I'd think most include the basics, like NVIC, Systick because that's what is needed for an OS and probably why they are in the core and not peripherals as such
 

Offline coppice

  • Super Contributor
  • ***
  • Posts: 10289
  • Country: gb
Re: Are the common ARM peripherals standardized and code compatible?
« Reply #7 on: February 19, 2022, 02:49:08 am »
If peripherals are standardized, then there would be no differentiation between the devices. No vendor will ever go for that. This is part of the reason why software side of the CMSIS failed.
People select one MCU over another for the clever peripherals, but not the very basic ones. There are a number of simple peripherals which could have been standardised with no effect on the competitive environment. Its certainly poor practice when you can't even move code from one MCU to another in the same vendor's product range, and expect basic peripheral code to function the same.
 

Offline coppice

  • Super Contributor
  • ***
  • Posts: 10289
  • Country: gb
Re: Are the common ARM peripherals standardized and code compatible?
« Reply #8 on: February 19, 2022, 02:51:04 am »
Quote
Is it expected for common peripherals, like an I2C or a timer, to be the same between different manufacturers
No.  other than the "peripherals" that are considered part of the ARM core (NVIC, Systick, a few others), they vary quite wildly (even between different "families" from the same vendor.)
Indeed. And even some of these (such as Systick, ITM, etc.) may even be optional or proprietary depending on the vendor. Arm gives a lot of options on their IP.
sure, but I'd think most include the basics, like NVIC, Systick because that's what is needed for an OS and probably why they are in the core and not peripherals as such
Before the M series cores we had the ARM7 in MCUs, and even the interrupt controller was not a standard part of that. ARM like to keep things very lean. :)
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 12017
  • Country: us
    • Personal site
Re: Are the common ARM peripherals standardized and code compatible?
« Reply #9 on: February 19, 2022, 03:15:44 am »
People select one MCU over another for the clever peripherals, but not the very basic ones. There are a number of simple peripherals which could have been standardised with no effect on the competitive environment. Its certainly poor practice when you can't even move code from one MCU to another in the same vendor's product range, and expect basic peripheral code to function the same.
Sure, but standardizing and sticking to the same peripherals ensures no forward progress. You have to break compatibility sometimes to make improvements.

Now, if there was some perfect peripheral that is done and does not need improvement, then we can talk about fixing it. But I personally have not seen anything close to that.
Alex
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 16387
  • Country: fr
Re: Are the common ARM peripherals standardized and code compatible?
« Reply #10 on: February 19, 2022, 03:25:17 am »
If you want common peripherals to all look "the same" programming-wise... use the Arduino framework. :-DD
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4415
  • Country: us
Re: Are the common ARM peripherals standardized and code compatible?
« Reply #11 on: February 19, 2022, 03:37:52 am »
Quote
There are a number of simple peripherals which could have been standardised
The industry says "nope."  Not even gpio.  (not that GPIO turns out to be "simple", once you consider common features like pin-change interrupts, pull options, drive options, alternate pin functions, etc)

Quote
the Arduino framework.
It is really sad that the "Arduino Framework" is pretty much as close as you can get to a multi-vendor abstraction of common peripherals...
You can look at what ARM tried to do for CMSIS-Driver, but ... it's pretty awful.  (Doesn't include GPIO or I2C, either.)
None of the "vendor libraries" have any commonality with each other, either.  (And of course, they tend to want to support every possible feature of the hardware.)
 

Offline coppice

  • Super Contributor
  • ***
  • Posts: 10289
  • Country: gb
Re: Are the common ARM peripherals standardized and code compatible?
« Reply #12 on: February 19, 2022, 03:43:48 am »
People select one MCU over another for the clever peripherals, but not the very basic ones. There are a number of simple peripherals which could have been standardised with no effect on the competitive environment. Its certainly poor practice when you can't even move code from one MCU to another in the same vendor's product range, and expect basic peripheral code to function the same.
Sure, but standardizing and sticking to the same peripherals ensures no forward progress. You have to break compatibility sometimes to make improvements.

Now, if there was some perfect peripheral that is done and does not need improvement, then we can talk about fixing it. But I personally have not seen anything close to that.
If you want a basic low performance I2C interface, all you want is a basic low performance I2C interface. Now, if you want something fancy, buffered, tricky, low overhead and high throughput there's a reason to make a fancy peripheral. However, in most cases you could make the fancy one support a basic mode that is software compatible with the basic fully standard variant of the peripheral.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4415
  • Country: us
Re: Are the common ARM peripherals standardized and code compatible?
« Reply #13 on: February 19, 2022, 07:30:17 am »
Quote
in most cases you could make the fancy one support a basic mode that is software compatible with the basic fully standard variant of the peripheral.
Can you?   I mean, that's easy when you're writing a software library, but I'm not sure that it remains easy when you're talking about hardware.  For example, how do you handle bitrate choice (normally done by writing a divisor from some clock signal) in the face of differing system clock rates (and differing clock systems)?   Insist that all peripherals be driven by some fixed-rate clock by default?

And what do you do on something like a SAMD, where all of your serial protocols (USART, SPI, TWI) are handled by one reconfigurable set of "sercom" hardware?
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 16387
  • Country: fr
Re: Are the common ARM peripherals standardized and code compatible?
« Reply #14 on: February 19, 2022, 06:06:25 pm »
Quote
the Arduino framework.
It is really sad that the "Arduino Framework" is pretty much as close as you can get to a multi-vendor abstraction of common peripherals...
You can look at what ARM tried to do for CMSIS-Driver, but ... it's pretty awful.  (Doesn't include GPIO or I2C, either.)
None of the "vendor libraries" have any commonality with each other, either.  (And of course, they tend to want to support every possible feature of the hardware.)

I don't know if it's "sad". That's actually a matter related to all "cross-platform" solutions. They inevitably hinder performance, innovation and must cater for the lowest common denominator. This is not a truly viable approach for microcontrollers. I for one certainly would not want that if that meant (which would be sort of inevitable) less variety among vendors and lower performance in the end.
 

Offline coppice

  • Super Contributor
  • ***
  • Posts: 10289
  • Country: gb
Re: Are the common ARM peripherals standardized and code compatible?
« Reply #15 on: February 19, 2022, 06:23:33 pm »
Quote
in most cases you could make the fancy one support a basic mode that is software compatible with the basic fully standard variant of the peripheral.
Can you?   I mean, that's easy when you're writing a software library, but I'm not sure that it remains easy when you're talking about hardware.  For example, how do you handle bitrate choice (normally done by writing a divisor from some clock signal) in the face of differing system clock rates (and differing clock systems)?   Insist that all peripherals be driven by some fixed-rate clock by default?

And what do you do on something like a SAMD, where all of your serial protocols (USART, SPI, TWI) are handled by one reconfigurable set of "sercom" hardware?
In most cases you can. I've been through this a number of times. If you can't maintain emulation of a simpler peripheral without compromising the design (either performance or size) of a more feature rich peripheral you probably aren't really committed to the idea. If you have a simple USART module, and a simple SPI module, and a simple I2C module and you want to make an all encompassing module, a module with three sets of registers that emulate the three simple modules isn't going to be a big deal. You just need to take care about clash issues.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 12017
  • Country: us
    • Personal site
Re: Are the common ARM peripherals standardized and code compatible?
« Reply #16 on: February 19, 2022, 06:29:57 pm »
You can of course design some common standard for a minimal peripheral. But nobody would go it, since it just introduces another thing vendors need to maintain and verify.

And then, who defines that register set? You would need to get all the major device manufacturers into the same room to discuss this and come up with the standard. This takes away engineering time for no additional profit (actually potential loss of profit due to migration to competitors).

A good example of a cross-vendor collaboration is EEMBC, and it is not going too well. And they are not even defining anything silicon-related.
Alex
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4415
  • Country: us
Re: Are the common ARM peripherals standardized and code compatible?
« Reply #17 on: February 20, 2022, 12:24:40 am »
It's amusing to look at the CMSIS-driver implementaion for USART, which includes a "get capabilities" function that reports what I guess ARM considers to be "common" properties of a USART:

https://www.keil.com/pack/doc/CMSIS/Driver/html/group__usart__interface__gr.html#structARM__USART__CAPABILITIES

(now contemplate either the "simple" UART that supports all of those, or the application code that "should" confirm that the driver supports the features that it wants to use.)
 

Offline coppice

  • Super Contributor
  • ***
  • Posts: 10289
  • Country: gb
Re: Are the common ARM peripherals standardized and code compatible?
« Reply #18 on: February 20, 2022, 01:34:27 am »
It's amusing to look at the CMSIS-driver implementaion for USART, which includes a "get capabilities" function that reports what I guess ARM considers to be "common" properties of a USART:

https://www.keil.com/pack/doc/CMSIS/Driver/html/group__usart__interface__gr.html#structARM__USART__CAPABILITIES

(now contemplate either the "simple" UART that supports all of those, or the application code that "should" confirm that the driver supports the features that it wants to use.)
Well, a real application is only going to call a few of those things, but they really make no sense. These are embedded systems. If you test for a feature at run time, and find its not there, WTF is the software supposed to do next. Too many of these embedded support systems are put together by people who have only ever developed for big machines.
 
The following users thanked this post: langwadt

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 16387
  • Country: fr
Re: Are the common ARM peripherals standardized and code compatible?
« Reply #19 on: February 20, 2022, 03:41:15 am »
CMSIS for peripherals is a good illustration of something that will never be relevant.
 

Offline cgroen

  • Supporter
  • ****
  • Posts: 644
  • Country: dk
    • Carstens personal web
Re: Are the common ARM peripherals standardized and code compatible?
« Reply #20 on: February 20, 2022, 03:53:31 am »
CMSIS for peripherals is a good illustration of something that will never be relevant.

I was going to write the same, just with some much more harsh words....
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 9780
  • Country: fi
Re: Are the common ARM peripherals standardized and code compatible?
« Reply #21 on: February 20, 2022, 08:59:39 am »
The only way to pull this of is, ARM the company has to design
* Easy to use
* Simple
* Well performing
* Feature-rich,

in other words, very good peripherals, and then license them to manufacturers such as ST at affordable enough price. Only this will make it happen.

The same is true for the cores itself. It's not that ST or NXP etc. actually want you to easily port between different manufacturers. No, the only reason they use ARM ecosystem is that it's good. Own proprietary solutions would take more time-to-market and still likely perform worse. Writing compilers especially is a lot of work!

The compatibility thing is just a side effect. Possibly even unwanted one to some of the managers at these companies!

Any peripheral compatibility attempt which looks like it's made by a committee for compatibility reasons, is doomed to fail. The only thing that matters is good set of good peripherals, and manufacturers know that.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf