cancel
Showing results for 
Search instead for 
Did you mean: 

How to add HAL Library in STM32F1 in Keil.

MAhme.6
Associate

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.

1 ACCEPTED SOLUTION

Accepted Solutions

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 Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

1 REPLY 1

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 Venmo
Up vote any posts that you find helpful, it shows what's working..