Here is the whole program (it is a skeleton for I2C-DMA transfer):
Code: Select all
#include "stm32f1xx.h"
#include "stm32f1xx_ll_bus.h"
#include "stm32f1xx_ll_gpio.h"
#include "stm32f1xx_ll_utils.h"
#include "stm32f1xx_ll_rcc.h"
#include "stm32f1xx_ll_system.h"
void setupClock(void) {
// 72MHz from 8MHz HSE
LL_UTILS_PLLInitTypeDef pll;
pll.Prediv = LL_RCC_PREDIV_DIV_1; // 8MHz / 1 = 8MHz
pll.PLLMul = LL_RCC_PLL_MUL_9; // 8MHz * 9 = 72MHz
LL_UTILS_ClkInitTypeDef clk;
clk.AHBCLKDivider = LL_RCC_SYSCLK_DIV_1;
clk.APB1CLKDivider = LL_RCC_APB1_DIV_2;
clk.APB2CLKDivider = LL_RCC_APB2_DIV_1;
// configure clock
LL_PLL_ConfigSystemClock_HSE(8000000,LL_UTILS_HSEBYPASS_OFF,&pll,&clk);
SystemCoreClockUpdate();
Serial.print("SystemCoreClock: ");
Serial.println(SystemCoreClock);
}
void setupDMA(void) {}
void setupI2C(void) {}
void setup() {
Serial.begin(115200);
setupClock();
// spočítej a uož frekvence SYSCLK,AHB a APB do struktury "clocks"
LL_RCC_ClocksTypeDef clocks; // <-- !!! this line is causing error
LL_RCC_GetSystemClocksFreq(&clocks); // <-- !!! this line too
setupI2C();
setupDMA();
}
void loop() {
Serial.print(".");
delay( 1000 );
}
When this line (and next one) is commented out then program is compiled successfully.LL_RCC_ClocksTypeDef clocks;
Most of LL_RCC_* functions/constants are defined in file stm32f1xx_ll_rcc.h - including others, which are used without problems.
Just I observed that LL_RCC_ClocksTypeDef is compiled conditionally by:
What is purpose of variable USE_FULL_LL_DRIVER and where/when it should be defined?#if defined(USE_FULL_LL_DRIVER)