2020-06-14 06:38 AM
Hi, everyone.
I have found a bug in my code resulting division by zero (float).
We get hard fault if we try to divide an integer number by zero. So how does this process work for float numbers? I have tried this code and result is very strange. MCU hangs. After WDT reset, i see Bus Fault has been triggered.
float a, b, c;
c = 0;
a = b / c;
We are using STM32F746 with STM32CubeIDE. SDMMC(FatFS) , Ethernet, FMC, 4 Timers are enabled. One of these timers generates interrupt on every 250uS.
My questions are:
Thanks in advance.
Solved! Go to Solution.
2020-06-14 09:45 AM
2020-06-14 09:45 AM
Check out AN4044 and this:
https://hackaday.com/2018/11/21/creating-black-holes-division-by-zero-in-practice/
2020-06-14 10:33 AM
It is very helpful. Thank you.