cancel
Showing results for 
Search instead for 
Did you mean: 

stm32l0xx _ll_ spi.h not generating in my project

BChav.1
Associate III

Hi all,

I have just started working with stm32 and i am trying to port some example code from stm32f0 to stm32l0 board.

When i configured my project on L073rz board with same configs in F0 series i am getting errors for some api's available in stm32l0xx _ll_ spi.h in F0 series code(e.g"LL_SPI_SetDataWidth())".When i checked the files in HAL_driver directory,i found that there is no file named "stm32l0xx _ll_ spi.h" which has those function definitions.Can someone please tell me what is wrong?

2 REPLIES 2
Imen.D
ST Employee

Hello @BChav.1​ and welcome to the Community :)

Which CubeMx release are you using for migration?

The spi.h file is generated when Project Manager > Code Generator > Generate peripheral initialization as a pair of... field is checked. When it is generated, the include of this file will be called in main.c.

Otherwise, check the Include paths. For that, go to Project options ->C/C++ tab->Include paths and add new paths to the include directories.

Please have a look at this resources that may help:

When your question is answered, please close this topic by choosing Select as Best.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Pavel A.
Evangelist III

@BChav.1​ Have you selected use of LL driver for SPI? This is in project manager/aa\Advanced settings.

Another (better IMHO) choice is NOT to copy the library files but rather add them as reference.

Then the include path generated for your project points to the library on the "Cube repository" which contains all files. Then you can just add the #nclude's for needed files, they aways are available even if not inside your project dir.