2018-01-01 08:01 AM
Hello,
I implemented the folloing codesnipped (using to set the USART baudrate). :
uint32_t periphclk = LL_RCC_GetUSARTClockFreq(LL_RCC_USART2_CLKSOURCE);
uint32_t oversampling = LL_USART_GetOverSampling(USART2); if (periphclk != LL_RCC_PERIPH_FREQUENCY_NO) { LL_USART_SetBaudRate(USART2, periphclk, oversampling, BAUDRATE); }But I get the following linking error out ouf the first snipping line:
.\Objects\simpel_gpio_test.axf: Error: L6218E: Undefined symbol LL_RCC_GetUSARTClockFreq (referred from main.o).
Not enough information to list image symbols.Not enough information to list load addresses in the image map.Can someone explain me, how to give the linker the needed information? If I use a hardcoded periphclk or if I use __LL_RCC_* macros like __LL_RCC_CALC_MSI_FREQ(), the code compile and link without erros....
I'm using KEIL uVison5.
Does some hase any idea? ...
Thank you so much
Solved! Go to Solution.
2018-01-04 04:20 AM
Yesterday I solved the problem already. I added the define also in the
stm32l4xx_ll_rcc
.c
lib source file. Not nice, but 'it works for me' and now the linker is also happy... I don't know, why I need this only in this file, not in other ones which also need this flag ...Thank you for your help and
kind regards.
2018-01-01 08:29 AM
Linker complaining you don't provide source for the code you call, review what source is in the project.
Add
stm32l4xx_ll_rcc.c
to the project (or equivalent for STM32 family being used)STM32Cube_FW_L4_V1.10.0\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_rcc.c
2018-01-01 09:09 AM
Exactly the same way you'd solve it in any other toolchain!
This is basic programming stuff; not specific to Keil; not specific to embedded - not even specific to 'C' !
2018-01-02 04:12 AM
Hello and thank you for your replay !
I know that it is 'basic' stuff. But I defined the need Flag 'USE_FULL_LL_DRIVER', The file is in my project (like other files which compile without problems) and I add the needed lib paths to the project setting. I have currently no idea, which I forgot for this file...
The function isn't also 'static' (but this would be an error in this stm file...)2018-01-02 06:37 AM
How & where did you define that flag?
IS the file actually being compiled?
2018-01-03 02:23 AM
Hello Adrew,
I make the #define in my main.h, before the howl includes. The file compiles without erros, like all other ones and I get the object.o files. Other libs (like the ll_usart) works without errors (need the same #define 'USE_FULL_LL_DRIVER' ...
2018-01-03 03:59 AM
,
,
Marco Israel wrote:
I make the ♯ define in my main.h, before the howl (sic) includes.
Should that say, 'HAL includes' ?
But does it also need to be seen by the LL/HAL source files ... ?
Try it in Project defines ...
2018-01-03 04:57 AM
@Marco : maybe LL_RCC_GetUSARTClockFreq is not available for your specific chip model.
For example I have STM32F446xx and can't find it in CubeMx repository/drivers for this chip. (v 1.18)
This is the point with the LL stuff vs. HAL: it's very specific for the chip variant...
-- pa
2018-01-03 05:08 AM
pavel a wrote:
@Marco : maybe LL_RCC_GetUSARTClockFreq is not available for your specific chip model.
If that were the case, surely he'd get a compiler error saying so?
2018-01-04 04:20 AM
Yesterday I solved the problem already. I added the define also in the
stm32l4xx_ll_rcc
.c
lib source file. Not nice, but 'it works for me' and now the linker is also happy... I don't know, why I need this only in this file, not in other ones which also need this flag ...Thank you for your help and
kind regards.