This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

error: 'stm32f0xx_hal.h' file not found, when not using HAL libraries.

Keil seems to be ignoring the comments when building. The full error is:

RTE/Device/STM32F072RBTx/system_stm32f0xx.c(48): warning: In file included from...
C:/Users/admiralk/AppData/Local/Arm/Packs/Keil/STM32F0xx_DFP/2.1.1/Drivers/CMSIS/Device/ST/STM32F0xx/Include\stm32f0xx.h(255): error: 'stm32f0xx_hal.h' file not found
 #include "stm32f0xx_hal.h"
                 ^~~~~~~~~~~~~~~~~

The bit throwing the error:

#if defined (USE_HAL_DRIVER)
 #include "stm32f0xx_hal.h"
#endif /* USE_HAL_DRIVER */

And where it is commented out:

#if !defined  (USE_HAL_DRIVER)
/**
 * @brief Comment the line below if you will not use the peripherals drivers.
   In this case, these drivers will not be included and the application code will 
   be based on direct access to peripherals registers 
   */
  /*#define USE_HAL_DRIVER */
#endif /* USE_HAL_DRIVER */

Unless I am missing something, or this got defined somewhere else, I should not be getting an error.

I am trying to work through the lessons from here: https://www.st.com/content/st_com/en/support/learning/stm32-education/stm32-moocs/Moving_from_8_to_32_bits_workshop_MOOC.html

I realize that is kind of old, so maybe I am not finding a checkbox to tick, or untick, somewhere? The direct access part is the main reason for me following the lessons. I can skip it for now, but would really like to know how to get it working.

Thanks, Kirk

Parents
  • Thanks .

    I went with #2 and that did the trick. I will need to look around and see what that actually does, but it is good for now. I had a feeling it was something that got added in an update as that made the most sense. The next project does use HAL libraries, so downgrading did not seem like the bets option at the moment. When I started this, the package manager had problems connecting and I had to download the packages and manually install them.

    Anyway, Hopefully that is the last of my troubles, at least for a while.

    Thanks again, Kirk

Reply
  • Thanks .

    I went with #2 and that did the trick. I will need to look around and see what that actually does, but it is good for now. I had a feeling it was something that got added in an update as that made the most sense. The next project does use HAL libraries, so downgrading did not seem like the bets option at the moment. When I started this, the package manager had problems connecting and I had to download the packages and manually install them.

    Anyway, Hopefully that is the last of my troubles, at least for a while.

    Thanks again, Kirk

Children
No data