RTC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-30 10:14 PM
Hi Everyone,
I'm using a STM32H747XIH6 board.
checking RTC(Real Time Clock), peripheral through generating gui in STM32cubeide and configuring in STM32cubemx . After all the application completion I'm facing this kind of error ;
"gui/src/model/Model.cpp:3:10: fatal error: stm32h7xx_hal.h: No such file or directory
#include "stm32h7xx_hal.h" in touchgfx run simulator".
If I remove the particular header file in stm32 cubeide the code is not working .
so anyone can help me out ?
Thanks.
Solved! Go to Solution.
- Labels:
-
TouchGFX
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-31 3:18 AM - edited ‎2024-05-31 3:19 AM
Your PC isn't an STM32. The simulator doesn't emulate the STM32. So it cannot use any of the STM32 HAL libraries.
The solution is simple:
- use the compiler define SIMULATOR to detect if it is a simulator. You can use #ifdef SIMULATOR or #ifndef SIMULATOR. Then only include stm32h7xx_hal if it is not the simulator.
- in case you want the time in the simulator you can use time.h instead
I made a simple clock application this way. It shows date and time and runs in simulator and on target.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-30 11:46 PM
The simulator does not have a dependency on the STM32 HAL. As in the simulator you cannot interface with the STM32 hardware. If you want to test code using the RTC, you should run the code on the target. If you want to run the simulator you have to ensure the code that is used in the Model does not directly depend on the STM32 HAL.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-31 3:18 AM - edited ‎2024-05-31 3:19 AM
Your PC isn't an STM32. The simulator doesn't emulate the STM32. So it cannot use any of the STM32 HAL libraries.
The solution is simple:
- use the compiler define SIMULATOR to detect if it is a simulator. You can use #ifdef SIMULATOR or #ifndef SIMULATOR. Then only include stm32h7xx_hal if it is not the simulator.
- in case you want the time in the simulator you can use time.h instead
I made a simple clock application this way. It shows date and time and runs in simulator and on target.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-31 4:41 AM
Hello @Aashritha_Vuda and welcome to the community!
The previous answers seems to answer your question quite clearly.
Please keep us updated on your progress! :smiling_face_with_smiling_eyes:
Regards,
Software engineer at ST (TouchGFX)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-20 1:33 AM
Hello @Aashritha_Vuda ,
Have you been able to move forward with your project?
If one of the previous comment helped you solve your issue, I invite you to select it as "best answer".
If you are still encountering problems, I invite you to give us more information so we can help you.
Regards,
Software engineer at ST (TouchGFX)
