Skip to main content
Associate
March 2, 2026
Solved

Can't include custom source file

  • March 2, 2026
  • 3 replies
  • 189 views

Hi,

I wrote my own source file. It is located in the Core/Src directory. I have also entered it accordingly in cmakelists.txt.

my cmakelists.txtmy cmakelists.txt

Now I get an error saying that the include files from the Drivers directory are missing.

Bildschirmfoto vom 2026-03-02 09-45-19.png

If I remove my entry, I no longer get the error. But then I can't use my customs. Is there a sample cmakelists.txt that includes customs?

Thank you,

Funnypinky

Best answer by TDK

If it's like other families, you should only include the top-level "stm32wlxx_hal.h", and not individual HAL files.

3 replies

Nawres GHARBI
Technical Moderator
March 2, 2026

hi @Funnypinky 

for me seems an include issue, how did you manage the includes in your custom file please ? 

Associate
March 2, 2026

Hi @Nawres GHARBI ,

i include the 

    stm32wlxx_hal_def.h
 
think you i must include the another files?
TDK
TDKBest answer
Super User
March 2, 2026

If it's like other families, you should only include the top-level "stm32wlxx_hal.h", and not individual HAL files.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Associate
March 2, 2026

Thank you, was a little mistake, but a big search.

t_j_l
Associate II
March 5, 2026

You should modify it to Core/Src/ina226/ina226.c