2022-02-26 09:53 PM
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!
2022-02-28 03:33 AM
CMSIS = Common Microcontroller Software Interface Standard is from ARM. CMSIS-Core is a (mostly?) "header only" software view of the MCU containing register&bit definitions for the ARM core and STM32 peripherals like SPI. It is good for register level programming from
GPIOB->BSRR = GPIO_PIN_3;
for switching a LED, to sophisticated peripheral programming. Register and bit naming highly corresponds to the STM32 reference manuals and the debugger SFR view (.svd files). CMSIS-Core contains few functions for ARM components like NVIC and startup.
HAL builds up upon this with its own API. Some use it, some don't. You may mix both, e.g. let STM32CubeMX generate code for clock initialization and peripheral setup and use register-level prog for a time-critical interrupt handler. HAL makes starting easier, but you may hit its limits or bugs in complex scenarios.
Haven't used the Keil driver API, but IIRC have seen them using HAL. Might be useful if you need some cross-vendor compatability. Sure, CMSIS has some extras like FFT, DSP,... not covered by STM32 HAL at all.
hth
KnarfB