FPU initialization warning
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-04-04 6:04 AM
Hello,
I am developing an application, starting from stm32 empty project.
The main file presents the following preprocessor header, that triggers the reported FPU initialization warning when I try to build the project.
#if !defined(__SOFT_FP__) && defined(__ARM_FP)
#warning "FPU is not initialized, but the project is compiling for an FPU. Please initialize the FPU before use."
#endif
The FPU project settings are the following.
Why I have this warning?
Regards,
Carlo
Solved! Go to Solution.
- Labels:
-
STM32H5 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-04-04 7:59 AM - edited ‎2024-04-04 8:32 AM
Hello,
See this thread.
Starting from Empty project needs to initialize the FPU yourself.
Starting from STM32Cube project, lets you using the HAL driver which in turn initializes the FPU for you in system_stm32h5xx.c / SystemInit():
void SystemInit(void)
{
uint32_t reg_opsr;
/* FPU settings ------------------------------------------------------------*/
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
SCB->CPACR |= ((3UL << 20U)|(3UL << 22U)); /* set CP10 and CP11 Full Access */
#endif
.
.
If you select FP implementation by software, the warning message disappears as you won't use HW FPU:
Hope it does answer your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-04-04 7:59 AM - edited ‎2024-04-04 8:32 AM
Hello,
See this thread.
Starting from Empty project needs to initialize the FPU yourself.
Starting from STM32Cube project, lets you using the HAL driver which in turn initializes the FPU for you in system_stm32h5xx.c / SystemInit():
void SystemInit(void)
{
uint32_t reg_opsr;
/* FPU settings ------------------------------------------------------------*/
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
SCB->CPACR |= ((3UL << 20U)|(3UL << 22U)); /* set CP10 and CP11 Full Access */
#endif
.
.
If you select FP implementation by software, the warning message disappears as you won't use HW FPU:
Hope it does answer your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-04-05 12:16 AM
Thank you for the quick and clear response.
Regards,
Carlo
