Skip to main content
MAhme.6
Visitor II
March 7, 2022
Solved

How to add HAL Library in STM32F1 in Keil.

  • March 7, 2022
  • 1 reply
  • 6885 views

Hi,

I'm looking for the right steps to add the Hal library to a Keil project.

i already have the stm32f1xx hal library that include the hal and the cmsis folders (src and include).

i'm facing some problem with linking the library. so if someone can tell me the steps i need to follow to build the project.

This topic has been closed for replies.
Best answer by Tesla DeLorean

You should be able to open, or clone, the project examples under the CubeF1 trees, it might want to pull the STM32F1 pack

Look at construction and meta-data settings of an example

\STM32Cube_FW_F1_V1.8.4\Projects\STM32F103RB-Nucleo\Examples\CRC\CRC_Example\MDK-ARM\Project.uvprojx

To add to something else?

You'd need to set up Include Paths, based on YOUR relativity to them

 ../Inc;../../../../../../Drivers/CMSIS/Device/ST/STM32F1xx/Include;../../../../../../Drivers/STM32F1xx_HAL_Driver/Inc;../../../../../../Drivers/BSP/STM32F1xx_Nucleo

Add some command line defines for Library and CPU (USE_HAL_DRIVER,STM32F103xB,USE_STM32F1xx_NUCLEO)

Pull in the Library source files to a sub-group in your project

Create a stm32f1xx_hal_conf.h to pull in/enable sub components

STM32Cube_FW_F1_V1.8.4\Projects\STM32F103RB-Nucleo\Examples\CRC\CRC_Example\Inc\stm32f1xx_hal_conf.h

1 reply

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
March 7, 2022

You should be able to open, or clone, the project examples under the CubeF1 trees, it might want to pull the STM32F1 pack

Look at construction and meta-data settings of an example

\STM32Cube_FW_F1_V1.8.4\Projects\STM32F103RB-Nucleo\Examples\CRC\CRC_Example\MDK-ARM\Project.uvprojx

To add to something else?

You'd need to set up Include Paths, based on YOUR relativity to them

 ../Inc;../../../../../../Drivers/CMSIS/Device/ST/STM32F1xx/Include;../../../../../../Drivers/STM32F1xx_HAL_Driver/Inc;../../../../../../Drivers/BSP/STM32F1xx_Nucleo

Add some command line defines for Library and CPU (USE_HAL_DRIVER,STM32F103xB,USE_STM32F1xx_NUCLEO)

Pull in the Library source files to a sub-group in your project

Create a stm32f1xx_hal_conf.h to pull in/enable sub components

STM32Cube_FW_F1_V1.8.4\Projects\STM32F103RB-Nucleo\Examples\CRC\CRC_Example\Inc\stm32f1xx_hal_conf.h

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..