2023-04-07 08:58 AM
Hello,
I just created a new project on CubeMX for a STM32F407G-Disc1. I'm working with last version of MX, firmware.
The project is configured to build with Makefile.
Have a double variable modification causes a MCU HardFault_Handler to trigger.
Any idea why the default project do not allow to use double?
Thank you
2023-04-07 09:04 AM
When MX is configured for STM32CubeIDE compilation, it is working.
I will have a look at configuration, but if you have any idea...
Thank you
2023-04-07 01:12 PM
Have you modified the generated makefile ?
2023-04-07 08:52 PM
Watch for unaligned pointers or structures, say files, or data on a comms link.
The LDRD / STRD will fault on unaligned addresses.
Look at the instructions/code that's actually faulting
2023-04-08 11:45 AM
Do you really need "double" vs "float" which maybe HW float co-pro ?
Otherwise, maybe the double math library is conflict with float ?
2023-04-08 11:34 PM
Double uses twice as much memory as float. It could be that you’ve run out of memory, perhaps on the stack, particularly if you’re using an array of what are now doubles.
2023-04-10 01:52 AM
Hello @ANauz.1
First let me thank you for posting.
If modifying a double variable causes a HardFault_Handler to trigger in your STM32F407G-Disc1 MCU, it's possible that there is an issue with how the double variable is being used or accessed in your code. Here are some possible causes of this issue:
Thx
Ghofrane