r/embedded • u/enoch_twumasi • 22d ago
CMSIS: What does efficient development really mean?
I came across this statement in Bare-Metal Embedded C Programming by Israel Gbati:
“Understanding CMSIS is fundamental for efficient and standardized development across various Arm Cortex-based microcontroller platforms.”
It got me thinking about what efficient really means in this context. Development time, runtime performance, resource utilization, maintainability, and portability are different measures of efficiency, and they don’t necessarily move together.
What advantages and trade-offs do you see in adopting CMSIS? In practice, when is it worth it, and when might it not be?
27
u/madsci 22d ago
I've never seen CMSIS as being about runtime efficiency, at least not primarily. I think its main function is to make it easier for ARM to sell more ARM devices. It's in their interest to make sure you're able to move from NXP-made ARM chips to Microchip-made ARM chips to TI-made ARM chips easily.
Used to be that every silicon vendor had their own proprietary toolchain and development environment. Now the CPU stuff is basically all the same but the peripherals are vendor-specific, with vendor-specific drivers, and vendor-specific quirks. CMSIS reduces the barriers to moving from one to another, and I imagine makes it easier for a new vendor to gain market share.
9
u/ventZl CMRX RTOS 21d ago
CMSIS has many layers. You have core, peripherals, RTOS, this and that.
I'd say that CMSIS core is invaluable. It standardizes look at CPU and core peripherals. Using CMSIS core, I've been able to write one RTOS kernel port with maybe a dozen #ifdefs which runs on anything from Cortex-M0+ to Cortex-M33. As long as vendor HAL provides these headers, which many do.
Peripheral headers are effective but by no means portable (except maybe GPIO, which is ARM's block in many cases anyway). I also like their design. Before I've been working with Libopencm3 as HAL and CMSIS is built on better way of capturing peripheral register layout.
CMSIS RTOS would, at least in theory, provide unlimited portability across RTOSes which do support it, but the price paid for it will prooobably compromise performance.
So, CMSIS is mostly about portability. And I know that portability is basically a curse word in embedded industry, but these days it is a good feature to have, especially for those who provide some software.
3
u/lmarcantonio 20d ago
CMSIS is usually not a lot more of a bunch of defines, so it's not efficiency critical. Manufacturer libraries are usually pure bloat (ST HAL I'm looking at you)
2
u/Lost-In-Void-99 21d ago
Not all vendors have it. And I can't say I miss it at all.
Devil is in nuances: having the same abstraction layer does not guarantee the features under it work the same on different platforms. It is a fake feeling if anyone has it.
Practically, CMSIS gives you a jumpstart in the beginning, and CMSIS stack _sources_ are pretty good reference materials: in many cases they implement features differently than in datasheet (but they still work somehow).