Skip to main content
SKaro
Associate II
May 19, 2019
Question

addin HAL driver to blinky project

I have started from blinky project and want to extend it for some PWM outputs on TIM2.

For this I need to make use of stm32f3xx_ll_tim.h.

I added into my main.c #include <stm32f3xx_ll_tim.h> without success

I added the file from 'Manage project Items' also without success!

Is the only way to add this driver over 'Manage Run-Time Environment'? The problem from this wizard I dont know which menu should I add in order to have this driver in my project!

Could anyone please help?

This topic has been closed for replies.

10 replies

Tesla DeLorean
Guru
May 19, 2019

Define "without success", what errors are you seeing?

Have you set up the Include Paths properly so it can find the .H files?

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
SKaro
SKaroAuthor
Associate II
May 19, 2019

Without success means that I cant make use any of the structs from this header file. Form example the file stm32f3xx_ll_tim.h hast a struct called LL_TIM_InitTypeDef, and once I define a variable from this struct (for example: LL_TIM_InitTypeDef TIM_TimeBaseStructure;) I get an error stating (use of undeclared identifier LL_TIM_InitTypeDef)

Do I need to define the include path? it should be already known from keil.

The .h file is located under C:\Keil_v5\ARM\PACK\Keil\STM32F3xx_DFP\2.1.0\Drivers\STM32F3xx_HAL_Driver\Inc

If this were an error, then I would get the error in the include line!!

Tesla DeLorean
Guru
May 19, 2019

You should be able to click on the .h file in the dependency tree under the .C, and have it open.

The next thing to check is if any #define/#ifdef stops the body of the file being included.

Make sure you have command line defines STM32F303xC,USE_FULL_LL_DRIVER (part as appropriate)

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
SKaro
SKaroAuthor
Associate II
May 19, 2019

Under the project tree on the left, when I expand the Blinky.c file under source files, then I can see the intended file (stm32f3xx_ll_tim.h).

This file has been available in this project tree first after adding the line #include "stm32f3xx_ll_tim.h" at the begining of the Blinky.c (which means it seems to be ok!).

Of course wehn I click on this stm32f3xx_ll_tim.h file then I have it opened (write protected mode).

I dont see any discrepency in the header file, so that the body will be stopped.

What you mean with the command line defines? Could you please give more explanation?