2019-05-19 01:49 PM
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?
2019-05-19 02:16 PM
Define "without success", what errors are you seeing?
Have you set up the Include Paths properly so it can find the .H files?
2019-05-19 02:25 PM
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!!
2019-05-19 03:18 PM
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)
2019-05-19 03:34 PM
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?
2019-05-19 04:58 PM
Options -> C/C++ -> Preprocessor Symbols -> Define
2019-05-20 01:26 PM
I owe you a ver big Thank.
as soon as I added STM32F303xC,USE_FULL_LL_DRIVER to the define then it worked!
But I dont know at all what this means, and why it does not work without it!!
2019-05-21 02:58 PM
I have again another problem now!
The suggested solution helped to compile the project, but during linking I get again errors like
Blinky.c(52): error: #20: identifier "LL_TIM_BDTR_InitTypeDef" is undefined
Any hint please?
2019-05-22 03:12 AM
I mean I dont understand why it works only when I define them from Options -> C/C++ -> Preprocessor Symbols -> Define!
Even when I write in my main.c the two define lines then it does not work?!!
#define STM32F303xC
#define USE_FULL_LL_DRIVER
2019-05-22 05:30 AM
> Even when I write in my main.c the two define lines then it does not work?!!
Because you've defined it only in main.c, Other .c files do not see these defines.
-- pa