Search code examples
armembeddedstm32microcontrollercmsis

why is CMSIS DRIVER not providing all the important drivers used in embedded world


I wanted to use CMSIS driver APIs instead of HAL provided by stm. when I visited the link CMSIS DRIVER APIs No where I found, the most commonly used drivers like pwm, adc, gpio etc., why is that so, do we have to depend on both CMSIS and HAL for Microcontroller programming?

I've tried to find the answer in the arm community also, there is one question asking the same, surprisingly, none given the answer for that.


Solution

  • A microcontroller contains a hardware core along with hardware peripherals such as GPIO and ADC. Arm Cortex-M is a core commonly used by microcontroller vendors such as STMicroelectronics, Espressif, NXP and others. But the hardware peripherals vary from vendor to vendor. (For example STMicroelectronic's ADC is different from Espressif's ADC.) Arm provides the CMSIS to interface with the hardware core defined by Arm. Microcontroller vendors provide a HAL to interface with their custom hardware peripherals. CMSIS does not include the vendor-specific peripherals because Arm does not define those peripherals. Think of the CMSIS as a layer above the common hardware core while the HAL is a layer above the CMSIS and the vendor-specific hardware peripherals.