cancel
Showing results for 
Search instead for 
Did you mean: 

Im new to CubeIDE. When Setting up RCC (Low speed clock) to crystal resonator and adding clock and calendar in RTC, it says the HAL_RTC_Init is not defined.. how can I fix this?

Amaresh
Associate III

0693W00000KauhSQAR.png

12 REPLIES 12
TDK
Guru

It means that the HAL RTC files haven't been included. Open up the *_hal_conf.h file and RTC module is enabled with the line:

#define HAL_RTC_MODULE_ENABLED

If you feel a post has answered your question, please click "Accept as Solution".
Amaresh
Associate III

@TDK​ 

As in, put this line in main? If so it still shows the same error.

Amaresh
Associate III

@TDK​ if u mean to enable it looks like it is already enabled

0693W00000Kb4HtQAJ.png

TDK
Guru

No, in *_hal_conf.h. The line should already be in there, ensure it's not commented.

If you feel a post has answered your question, please click "Accept as Solution".
TDK
Guru

Include your IOC file if you can, or project code.

If you feel a post has answered your question, please click "Accept as Solution".
Amaresh
Associate III

Yes the above picture in inside hal_conf.h as you can see the second last define shows it has been enabled by default.

TDK
Guru

I'm not sure, looks like it should be working. Can you post the exact error message(s) you're getting?

If you feel a post has answered your question, please click "Accept as Solution".
Amaresh
Associate III

0693W00000KbAaSQAV.png