I’ve done quite a lot of programming on LPCs (great chips and environment BTW) and I confess that I’m still not 100% sure how useful CMSIS is. Yes it’s supposed to be an abstraction layer for the ARM, but how many people actually work with the ARM core? Answer, almost none.
Here is a snippet from my main() func
// Enable AHB clock for GPIO ports
LPC_SYSCON->SYSAHBCLKCTRL |= _BV(AHB_GPIO1) | _BV(AHB_GPIO0);
The definitions here are from an H file in the CMSIS folder, but this is very LPC specific, no way that code will run on a SAM or ST. So there is a small abstraction level there but not much and certainly not portable.
Here is some more setup code
LPC_SYSCON->SYSOSCCTRL = 0;
LPC_SYSCON->PDRUNCFG &= ~(1 << 5);
LPC_SYSCON->SYSOSCCTRL = 1;
This is obviously dealing with the ARM core which will be the same on all M0 chips, but the left values at least have an LPC_ prefix so once again this code won’t work on another family, even is if all boils down to the same address, offsets and code.
And this is working directly with the M0 core, almost nobody does that except maybe a little setup code, most code is either generic C/C++ that will run anywhere or deals with the chip’s peripherals which are totally different on all families.
So for the average user I see almost no benefit to CMSIS, they need a real HAL framework like the Arduino.
NXP gets points for removing restrictions on the free version of their LPCXpresso IDE, namely C++ support is now included, and code size limitations eased or removed.
Yes, I ported most of the Arduino core to LPC122x, but that was before they opened up the compiler and I had to do it all in C so things like Serial.begin() had to be SerialBegin() etc. I got it to the stage where you could run a simple Arduino sketch with very few changes to the code.
Now that C++ is free I’ve started porting the code to C++. I haven’t got far with the conversion though because I have too many other things to do.