cancel
Showing results for 
Search instead for 
Did you mean: 

Undefined reference to 'HAL_RTC_Init' problem

지한.1
Associate II

Hi, I want to use the RTC. ( Use STM32F429ZI Discovery board )

So, I set

1. RCC-> High Speed Clock Cystal/Ceramic Resonator

RCC-> Low Speed Clock Cystal/Ceramic Resonator

0693W00000JMfiJQAT.png2. Clock Configuration -> RTC Clock Mux -> LSE

0693W00000JMfjbQAD.png3. Pinout & Configuration -> Timers -> RTC -> Active Clock Source

0693W00000JMfiLQAT.png4. Generate Code and Build project but, failed

0693W00000JMflrQAD.png

Can you help me to solve this problem?

5 REPLIES 5
Aime
ST Employee

Hello @지용 한​ ,

Thank you for reporting your issue, I will try to help you on it :) .

First on my side, I started a new project following the same steps as you and it works properly. You can try it on your side with my project attached. I am using STM32CubeIDE V1.7.0.

Now let's try to understand your issue, please provide me more details on your project.

  • What's IDE do you use ? (STM32CubeIDE, EWARM ...)
  • What's your version of STM32CubeMX ? Sometimes just by using the latest version can solve your issue.
  • Are you using all the includes generated by STM32CubeMX ?

Thank you for your responses.

A.MVE

Hi,

  1. I used STM32CubeIDE ( Version 1.8.0 )0693W00000JMmcXQAT.png
  2. Maybe STM32CubeMX version is 6.4.0.xxxxxx0693W00000JMmdGQAT.png
  3. I generate code, STM32CubeIDE.

I think, the problem is importing from TouchGFX to STM32CubeIDE.

TouchGFX Desinger version is 4.18.1

The order of execution is as follows.

  1. In TouchGFX, Make project and generate code. ( ex. Project name is MyTemplate. )
  2. In STM32CubeIDE, File -> Open Proejct File system.
  3. In STM32CubeIDE, Import Project from File System or Archive -> Directory -> Find MyTemplate proejct and Finish0693W00000JMmeiQAD.png
  4. In STM32CubeIDE, Click STM32F249I-DISCO( in STM32CubeIDE ) and success build0693W00000JMmexQAD.png
  5. In STM32CubeIDE, Click STM32F429I_DISCO_REV_E01.ioc and rename MyTemplate.ioc.0693W00000JMmfRQAT.png
  6. In STM32CubeIDE, Open MyTemplate.ioc file and RCC setting. ( HSE -> Crystal/Ceramic Resonator, LSE -> Crystal/Ceramic Resonator )0693W00000JMmfqQAD.png
  7. In STM32CubeIDE, RTC check Active Clock Source.
  8. In STM32CubeIDE, Save the MyTemplate.ioc file and Click STM32F249I-DISCO( in STM32CubeIDE ) icon build project.
  9. Undefined reference to 'HAL_RTC_Init'0693W00000JMmgtQAD.png

I ran a few test( DAC, ADC, UART ..), but all failed with similar problem.

( Undefined reference to 'HAL_DAC_init' ...)

Can you help me, how to import from TouchGFX to STM32CubeIDE?

Hi @지용 한​ ,

Thank you for your detailed description.

By following your steps I had the same issue, but I find a workaround that can help you :) . Before that please have you followed those installation steps.

Please can you try that on your side :

  1. In TouchGFX, Make project and generate code.  ( ex. Project name is MyTemplate. )
  2. Do to the TouchGFXProject directory C:\TouchGFXProjects\MyTemplate\STM32CubeIDE
  3. Open the project .project, that will open STM32CubeIDE and your IDE should look like that. 0693W00000JMoUGQA1.png
  4. Go to C:\TouchGFXProjects\MyTemplate\ open the file STM32F429I_DISCO_REV_E01.ioc with STM32CubeMX. I am using the version 6.3.0.
  5. In STM32CubeMX, Open MyTemplate.ioc file and RCC setting. ( HSE -> Crystal/Ceramic Resonator, LSE -> Crystal/Ceramic Resonator )
  6. In STM32CubeMX, RTC check Active Clock Source.
  7. In STM32CubeMX, generate code.
  8. In STM32CubeIDE, your project should be updated, build it.

That should solve your issue for now.

I will check internally why we can't use STM32CubeIDE to update the project.

Best Regards

A.MVE

Thank you for your help.

But, I have another issue.

I finished downloading the firmware, but nothing displayed on the LCD.

My Steps:

  1. In TouchGFX, Make project and generate code. ( ex. Project name is MyTemplate. )0693W00000JMvjhQAD.png
  2. Do to the TouchGFXProject directory C:\TouchGFXProjects\MyTemplate\STM32CubeIDE
  3. Open the project .project0693W00000JMvjwQAD.png0693W00000JMvkQQAT.png
  4. Go to C:\TouchGFXProjects\MyTemplate\ open the file STM32F429I_DISCO_REV_E01.ioc with STM32CubeMX( version 6.3.0.).
  5. In STM32CubeMX, Open MyTemplate.ioc file and RCC setting. ( HSE -> Crystal/Ceramic Resonator, LSE -> Crystal/Ceramic Resonator )0693W00000JMvkkQAD.png
  6. In STM32CubeMX, RTC check Active Clock Source.0693W00000JMvkpQAD.png
  7. In STM32CubeMX, generate code.0693W00000JMvkuQAD.png
  8. In STM32CubeIDE, your project should be updated, build it.0693W00000JMvl4QAD.png0693W00000JMvlEQAT.png
  9. In STM32CubeIDE, I connected ​the STM32F429-Discovery board and Run.0693W00000JMvlJQAT.png
  10. In STM32F429ZI-Discovery board LCD, I can't see nothing on the LCD.0693W00000JMvlTQAT.png

In STM32F429ZI-Discovery board, the LD1 LED blinks during firmware download.

Go to C:\TouchGFXProjects\MyTemplate\ open the file MyTemplate.touchgfx, I can see icons.

In TouchGFX, I can run simulator and see icons.

Could you help me the problem what is?

nbila.1
Associate

I understand what's problem. 

If you take look at the hierarchy under driver/stm32f4xx_HAL_Driver. 

You will notice hal file related to rtc not present. You have to link this file path so that this file will be available.

And after that compile code.