Skip to main content
Visitor II
April 30, 2022
Solved

missing stm32f4xx_hal_uart.h in STM32F4xx_HAL_Driver

  • April 30, 2022
  • 3 replies
  • 4301 views

I recently go the 32F413HDISCOVERY board and downloaded the projects and examples to a local folder and imported it all of it into STM32CubeIDE.

In the STM32CubeIDE I was able to open and modify the Test_001 project and blink LED2 and LED3.

Next, I wanted to send and receive some text from HyperTerminal on the PC, but it turns out the STM32F4xx_HAL_Driver does not include anything UART related in the Test_001 project.

The attached screen shot (Test_001 Drivers.jpg) shows everything in Test_001 \Drivers\STM32F4xx_HAL_Driver\Inc...stm32f4xx_hal_uart.h is missing.

How can I enable (bring in) stm32f4xx_hal_uart.h in the Test_001 project?

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

    Edit the IOC file, enable a UART peripheral, and re-generate the code. It will then include the UART library files and enable them within HAL.

    3 replies

    TDKAnswer
    Super User
    April 30, 2022

    Edit the IOC file, enable a UART peripheral, and re-generate the code. It will then include the UART library files and enable them within HAL.

    Super User
    April 30, 2022

    If you don't want to edit the IOC, you could also drag/drop the files into those folders from the repository and edit your stm32f4xx_hal_conf.h file to include the define for HAL_UART_MODULE_ENABLED.

    By default, on Windows, the repositories are located at:

    C:\Users\%USERNAME%\STM32Cube\Repository

    IMate.1Author
    Visitor II
    May 1, 2022

    I am new to ST and the development environment and didn't realize the IOC file opens up into a configuration tab. I was searching for a button on the toolbar.

    Thanks for the two separate approaches! It is working now.:ok_hand: