Bug Report: CubeMX Generates Bad Init Code
Like
•
Show 0 LikesComment
•
Using CubeMX V4.7.25.0 I get initialization code for RTC.c that won't compile when I request initialization be generated as .c.h file pairs.
Simple demo case:
Start CubeMX
New Project
Select STMf103C8Tx as target
Under Pins Select RTC-> Activate Clock Source.
Under Project settings:
Project Name: Test
Location: C:\Temp\
Under Code Generator Tab:
Check Generate peripheral initialization as pair of .c/.h files
Generate code for TrueStudio
When I build the generated code I get the following errors:
..\..\..\Src\rtc.c:73:5: warning: implicit declaration of function 'LL_PWR_EnableBkUpAccess' [-Wimplicit-function-declaration] LL_PWR_EnableBkUpAccess();..\..\..\Src\rtc.c:75:5: warning: implicit declaration of function 'LL_APB1_GRP1_EnableClock' [-Wimplicit-function-declaration] LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_BKP);..\..\..\Src\rtc.c:75:30: error: 'LL_APB1_GRP1_PERIPH_BKP' undeclared (first use in this function)
LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_BKP);If I generate code for the test project with the peripheral inits in main(), the project will then build without error.
Is this a CubeMx bug?
Dave
#cubemx-bug-init.-code