2013-03-22 01:09 PM
Hello,
I have a problem which i cannot resolve.My first code, a DCF77 receiver which update my RTC once a day runs fine without any problems.Now, i have added a new function to calculate the Sunrise or Sunset time for my location (Lat, Lon)In that function, another function is called to calculate someting. The first time this function is called, this function will be executed and works fine. the second time, i get a HardFault and i can not find out how.Sometimes, when it is running in Debugmode and i step slowly thru my code, it executes all my functions without any HardFault.When i comment the function call my program works fine. Can anybody help me?I have attached a screenshot of my debugger. As you can see it stuck at __Float64_mulI guess that it has something to do with the float64. But this function is executed earlier and does not cause a hard fault2013-03-26 12:54 PM
FPU instructions can hard fault on the STM32F4 if the math unit isn't enabled, this should not be an issue for you.
Commenting out code isn't going to help here. You need to clearly identify the failing assembler instructions, and the registers at the fault. Depending on the type of failure may also want to dig into the stack. If the printf() code doesn't have support in you tool chain you could always break point the hard fault handler and walk through it.2013-03-26 12:57 PM
Dueling posts, glad to hear you fixed it.