cancel
Showing results for 
Search instead for 
Did you mean: 

What is SPI vs SPI MSP for STM32

fsonnichsen
Associate II
Posted on March 28, 2016 at 17:23

I am new to the STM32 product line and starting to write SPI code using the STM32cubeMX module. I note in the cube drivers manual that they provide both HAL_SPI_Init and HAL_SPI_Mspinit.  Looking through the web and also the source code I cannot figure out which to use nor what the ''MSP'' feature of STM's SPI is. Can someone enlighten me here?

Many Thanks

Fritz
4 REPLIES 4
Nesrine M_O
Lead II
Posted on March 28, 2016 at 19:19

Hi Fritz,

Welcome to STM32 community :)

•Peripheral system level initialization/ de-Initialization callbacks : HAL_PPP_MspInit() / _DeInit() : Ex: HAL_SPI_MspInit() Called from HAL_PPP_Init() API function to perform peripheral system level initialization (GPIOs, clock, DMA, interrupt)

•Initialization and de-initialization functions:HAL_PPP_Init(), HAL_PPP_DeInit():Ex: HAL_SPI_Init() this function initializes the peripheral and configures the low -level resources (clocks, GPIO, AF..)

•For more details about The HAL drivers layer please refer to the

http://www.st.com/st-web-ui/static/active/en/resource/technical/document/user_manual/DM00105879.pdf

User Manual

-Syrine-

AvaTar
Lead
Posted on March 29, 2016 at 09:29

Sorry, but that does not answer the question WHAT the term ''MSP'' means in this context.

To the O.P.:

If in doubt about the context/intention of any HAL library code, consult the Reference Manual of your MCU variant.

In your case, especially the section about the SPI peripheral section. It describes in detail the peripheral unit and it's configuration registers, which the Cube/HAL software is intended to cover (with debatable results/quality).

dceccon87
Associate

Mixed Signal Processor

Reported from "Description of STM32F4 HALand LLdrivers"[1]:

The MspInit callback performs the low-level initialization related to the different additional hardware resources: RCC, GPIO, NVIC and DMA.

[1] https://www.st.com/content/ccc/resource/technical/document/user_manual/2f/71/ba/b8/75/54/47/cf/DM00105879.pdf/files/DM00105879.pdf/jcr:content/translations/en.DM00105879.pdf

You can't just guess a TLA... ;)0690X0000088I0qQAE.png

JW