2017-08-08 01:23 AM
I have just updated one of my projects to STM32F1 FW 1.6.0, and my code was not able to compiled anymore. IOC file attached.
Here is my clocking scheme:
As you can see the LSI oscillator is not used, so I assume this is why the LSI_VALUE is not generated to the stm32f1xx_hal_rcc.h file. However the LSI_VALUE constant is still used in the stm32f1xx_hal_rcc_ex.c:
case RCC_PERIPHCLK_RTC:
{
/* Get RCC BDCR configuration ------------------------------------------------------*/
temp_reg = RCC->BDCR;
/* Check if LSE is ready if RTC clock selection is LSE */
if (((temp_reg & RCC_BDCR_RTCSEL) == RCC_RTCCLKSOURCE_LSE) && (HAL_IS_BIT_SET(temp_reg, RCC_BDCR_LSERDY)))
{
frequency = LSE_VALUE;
}
/* Check if LSI is ready if RTC clock selection is LSI */
else if (((temp_reg & RCC_BDCR_RTCSEL) == RCC_RTCCLKSOURCE_LSI) && (HAL_IS_BIT_SET(RCC->CSR, RCC_CSR_LSIRDY)))
{
frequency = LSI_VALUE;
}
else if (((temp_reg & RCC_BDCR_RTCSEL) == RCC_RTCCLKSOURCE_HSE_DIV128) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_HSERDY)))
{
frequency = HSE_VALUE / 128U;
}
/* Clock not enabled for RTC*/
else
{
frequency = 0U;
}
break;�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?
#stm32f103 #cube-mx
Solved! Go to Solution.
2017-09-15 02:40 AM
Hello
Marton.Miklos
,I have tested under Ubuntu 5 LTS.
Using cube 4.1, I openned your ioc, and migrate it to that latest version.
Then I have generated the project and compile using Eclipse system workbench plugin.
F1 FMW version is 1.6.0.
Everything went well at my end (no compilation error).
You said that you are not able to compile anymore.
Could you please describe the symptoms and error you get ?
Thanks in advance
Kind regards
Sirma
2017-09-15 06:05 AM
Hi @Sirma Siang_O
After seeing that my updated CubeMX did not generated user sections to the USB init see here:
https://community.st.com/0D50X00009XkdmBSAR
I have reinstalled the CubeMX from scratch, and now the LSI_VALUE generation got corrected also.
Thank you for your help!
2018-03-14 04:29 PM
I've run into the same issue after updating STM32F1xx HAL from version 1.0.4 (STM32CubeF1 version 1.4) to version 1.1.1 (STM32CubeF1 version 1.6) on the existing project (not using CubeMX code generation).
stm32/projects/cpu/stm32/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c:579:21: error: 'LSI_VALUE' undeclared (first use in this function)
frequency = LSI_VALUE;
The relevant section of the HAL source code is shown below:
else if (((temp_reg & RCC_BDCR_RTCSEL) == RCC_RTCCLKSOURCE_LSI) && (HAL_IS_BIT_SET(RCC->CSR, RCC_CSR_LSIRDY)))
{
frequency = LSI_VALUE;
}
Any suggestions? Thanks!