Skip to main content
BChav.1
Associate III
November 14, 2022
Question

stm32l0xx _ll_ spi.h not generating in my project

  • November 14, 2022
  • 2 replies
  • 1488 views

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?

This topic has been closed for replies.

2 replies

Technical Moderator
November 14, 2022

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

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
Pavel A.
Super User
November 14, 2022

@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.