2012-01-10 02:41 AM
A little question,
When I'm trying to calculate a float I'll get ''ISR HardFaultVector_IRQn'' What am I doing wrong? My code: -------------------------------------------------------------------------------------------------------- uint32_t iTemperature = 0x1b8; double dTemperature = 0.0; dTemperature = (double)iTemperature*0.0625; -------------------------------------------------------------------------------------------------------- This goes wrong and I don't know why.. MCU = STM32F100RB6TB Greets, Dennis2012-01-10 05:04 AM
What am I doing wrong?
Using GCC, and importing a 32-bit ARM library for floating point? The Cortex-M3 only runs Thumb (16-bit) code, and Hard Faults with ARM (32-bit) code. Examine the processor state, identify the instruction that is faulting, should be easy enough to figure out why it dies rather than just guessing. Look at Joseph Yiu's suggested Hard Fault handler, it works better than while(1);
2012-01-11 03:07 AM
@clive1
Using GCC, and importing a 32-bit ARM library for floating point? Which library is this? Where can I find this information? (yep I'm going to order that book, if that would help me with this kind of problems.) Greets, Dennis2012-01-11 04:52 AM
libm.o ? I'm not a big GCC guy, but look at the makefile, and look at the -L library pathing. A .map file might also give some insight into the parts brought in by the linker, and a disassembly via objdump.
Joseph comes here occasionally, and there are a couple of examples out the internets.[DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Hard Fault and stack pushing&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=7790]https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2Fcortex_mx_stm32%2FHard%20Fault%20and%20stack%20pushing&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=7790