Skip to main content
Graduate
February 4, 2025
Solved

No such file or directory: debugging Makefile project with CubeIDE

  • February 4, 2025
  • 3 replies
  • 1744 views

Hello,

I have generated a makefile project on CubeIDE for STM32WB55RG and I'm trying to debugging it on CubeIDE . After a research on the forum I got to know that this is achievable and set up build settings accordingly. 

 

When I try to debug I get the error:

 

../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal.c:35:10: fatal error: stm32wbxx_hal.h: No such file or directory

   35 | #include "stm32wbxx_hal.h"

      | ^~~~~~~~~~~~~~~~~

compilation terminated.

 

I've checked my file system and the file does exist and on my Makefile file I have it included (4th code line)

 

# C includes
C_INCLUDES = \
-ICore/Inc \
-IDrivers/STM32WBxx_HAL_Driver/Inc \
-IDrivers/STM32WBxx_HAL_Driver/Inc/Legacy \
-IDrivers/CMSIS/Device/ST/STM32WBxx/Include \
-IDrivers/CMSIS/Include

 

 

Still don't understand why the file can't be found. Any clue?

 

    This topic has been closed for replies.
    Best answer by BentoCopi

    I finally got the project building and debugging.  I noticed that many unwanted files were present on my project tree (rtc, cmsis_os , etc.). I started to remove them one by one from the build and errors were going down. So, I went back to CubeMX-> project manager->Code generator and noticed that I accidentally had  Copy all used libraries into the project folder checked up instead of Copy only the necessary library files. 

     

    After that I still wasn't able to debug due to not having the MCU set up. This post helped me. Just make sure to choose the MCU ARM GCC toolchain on the step 1.

    https://community.st.com/t5/stm32cubeide-mcus/is-it-possible-to-debug-a-makefile-project-into-stm32cubeide/td-p/340784

    Thank you anyways @Javier1 

    3 replies

    Graduate II
    February 4, 2025

    >>When I try to debug I get the error:
    Your makefile is not debugging, i guess you need to add the 

    IDrivers/CMSIS/Device/ST/STM32WBxx/Include \

    to the path so CubeIDE knows, yeah i know, the famous "AdD iT tO ThE PaTh"

     

     Right click on your project in project explorer-> properties->C/C++ general -> Path and Symbols

    BentoCopiAuthor
    Graduate
    February 4, 2025

    I ended up adding all the files under C_INCLUDES from my makefile to the path and symbols. That error has gone and I was presented with 298 new errors. Errors like unsolved variables, not included standard c libraries,... . It seems like a generation error. It's just too much manual job to do.

    BentoCopiAuthor
    Graduate
    February 4, 2025

    I added the symbols under C_DEFS on the makefile to my CubeIDE symbols and now I got only 68 errors to work on.

    BentoCopiAuthorAnswer
    Graduate
    February 4, 2025

    I finally got the project building and debugging.  I noticed that many unwanted files were present on my project tree (rtc, cmsis_os , etc.). I started to remove them one by one from the build and errors were going down. So, I went back to CubeMX-> project manager->Code generator and noticed that I accidentally had  Copy all used libraries into the project folder checked up instead of Copy only the necessary library files. 

     

    After that I still wasn't able to debug due to not having the MCU set up. This post helped me. Just make sure to choose the MCU ARM GCC toolchain on the step 1.

    https://community.st.com/t5/stm32cubeide-mcus/is-it-possible-to-debug-a-makefile-project-into-stm32cubeide/td-p/340784

    Thank you anyways @Javier1