Please help me understand the relationship / layering between STM32 HAL drivers and Keil drivers.
Keil DFP seems to include STM32 HAL drivers. But they also provide their own drivers, which I assume are CMSIS-Drivers.
Thanks for your help!
Hi ziffusion,
in short:
HAL drivers are provided by STMicroelectronics for their devices/peripherals and use STMicroelectronics defined specification (API).
CMSIS drivers comply to the CMSIS-Driver specification (API).CMSIS drivers can use either HAL drivers or direct register accesses, or a combination of both, depending on the device series.
Both of these drivers, HAL and CMSIS drivers, can use CMSIS-Core functionality.
And in general they are similar in functionality / features aspects.
Just to add one obvious difference I forgot to mention:
HAL drivers are STMicroelectronics specific whereas CMSIS drivers are generic.
Meaning HAL drivers are only available for STMicroelectronics devices whereas CMSIS drivers are available for multiple devices and vendors.
Yeah this confused/confuses me too. I think Keil does provide some code specific to STM products so I think they may be an alternative to HAL*, but more likely an alternative to LL_ or SPL. I found the whole landscape quite daunting and it would be nice to see a document shows some simple project taking each of these solutions in turn. Even a simple Blinky project done in pure CMSIS, then in whatever the Keil pack provides that may be above CMSIS (if there is anything*), then SPL, LL and HAL.
GB
* Are the Keil device packs merely the headers for the STM parts or is there some free driver code that they bring? (Not dealing with the paid things like Keil RTOS/USB/etc).