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 05:46 AM
,
,
As noted previously, the correct place to do this is in the Project Defines - then you don't have to go manually editing individual files.
I guess this is what the User Manual means when it says (my emphasis):
5.14 How are LL initialization APIs enabled?
The definition of LL initialization APIs and associated resources (structure, literals and prototypes) is conditioned by the USE_FULL_LL_DRIVER compilation switch. To be able to use LL APIs,
add this switch in the toolchain compiler preprocessor.
It could be clearer.
,Marco Israel wrote:
I don't know, why I need this only in this file
Did you not spot, right at the top of that file:
/**
,
******************************************************************************
,
* @file stm32l4xx_ll_rcc.c
,
* @author MCD Application Team
,
* @version V1.6.0
,
* @date 28-October-2016
,
* @brief RCC LL module driver.
,
******************************************************************************
,
:
:
*/
,
♯ if defined(USE_FULL_LL_DRIVER)
2018-01-04 05:46 AM
There should be Keil Template LL projects under the source/example trees, if those build correctly review the structure and project metadata (defines, include paths, etc)
ST usually passes a define for the CPU and the Library being used. Include path order can make a differences if you have multiple instance of the same files
2018-01-05 02:38 AM
Thank you Andrew, and yes it works if I make the #define in the project settings...
Easy, if you know where (in which document and in which part) you find the needed information and how to understand it, mostly is clear ...hopefully ... or not ...
But mostly it feels like I search at the wrong places ...
:(
And thank you Clive, yes maybe I take the templates next time. I know about it... But I like to do it on may own to learn what I had/must do (or what I have not done and forgot) to learn my stuff... Out of errors you learn mostly the most in my opinion ... after you find the solution.... Sometimes this is a hard way to learn...
:(