13

I was wondering what the abbreviation "MSP" in HAL_xxx_MspInit() callbacks stands for. I have seen that in some firmware drivers like the HAL library from ST. For example:

void HAL_UART_MspInit(UART_HandleTypeDef *huart);
void HAL_SPI_MspInit(SPI_HandleTypeDef *hspi);

from stm32f3xx_hal_uart.h and stm32f3xx_hal_spi.h. I am wondering what Msp refers to. Is it just a naming convention for callbacks from init functions in drivers or does it have a deeper meaning (what I suspect it has).

StarSheriff
  • 1,477
  • 2
  • 17
  • 23
  • 2
    Wouldn't the ST forum be the appropriate place to ask for **their** naming convention?(Don't use that rubbish STLib anyway, it is clumsy, inflexible and bloats your code without any actual benefit.) – too honest for this site May 29 '16 at 19:43
  • 1
    I am not using it extensively. Only to quickly get some things running on my devboard. The reason I am asking SO is that I belief I have seen it from other vendors as well. I am mainly wondering if there is any reason in adopting such a convention for my own driver developments. – StarSheriff May 29 '16 at 19:47
  • As a personal note: The STlib naming convention is - well - uncommon. Typically names starting with all-uppercase are macros and `enum-constants only. So, no, you should not adopt it, And that is nothing specific. – too honest for this site May 29 '16 at 19:53
  • Thanks, that answers my question. – StarSheriff May 29 '16 at 19:56
  • 1
    Strictly speaking they are not *callbacks* - they are called directly and fully resolved at build-time rather than being called through a pointer assigned at runtime. – Clifford May 30 '16 at 08:36

1 Answers1

28

In STM32CubeMX it stands for MCU Support Package.

The STM32CubeMX documentation "STM32CubeMX for STM32 configuration and initialization C code generation" (UM1718) is clear on this - section 5.1:

enter image description here

It does however somewhat unhelpfully use the term several times in the documentation before it actually defines it!

Other aspects of the STM32CubeMX naming conventions are also defined in this document.

Clifford
  • 88,407
  • 13
  • 85
  • 165