Mon firmware pour stm32f103 provoque un problème matériel. Voici la ligne de code que l'exécution accident:cortex-m3 instruction fpu erreur matérielle
float shuntResistance = p[SHUNT_RESISTANCE];
où p - est un tableau global de flotteurs:
float p[CONFIG_NUM_PARAMS];
Il y a dissaembly pendant le débogage:
0800177c: ldr r3, [pc, #332] ; (0x80018cc <adcSetConstants+336>)
0800177e: vldr s10, [r3, #48] ; 0x30 ; on that instruction program results in hard fault
Voici compilateur drapeaux:
-c -fmessage-length=0 -mthumb -mcpu=cortex-m3 -mfloat-abi=softfp -ffunction-sections -fdata-sections -fsingle-precision-constant
drapeaux Linker:
-Wl,--static,--gc-sections,-Map=${ProjName}.map,-T../stm32_flash.ld -fmessage-length=0 -mthumb -mcpu=cortex-m3 -ffunction-sections -fdata-sections -fsingle-precision-constant -Dprintf=iprintf -u _printf_float -lc -lnosys -lc
compilateur utilisé est Launchpad bras-none-eabi-gcc. L'IDE utilisé est l'éclipse. Quelle est la cause?
Pouvez-vous publier le contenu de vos registres après la panne? – rost0031
En outre, jetez un oeil ici: https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=https%3a%2f%2fmy.st.com%2fpublic%2fSTe2ecommunities% 2fmcu% 2fLists% 2fcortex_mx_stm32% 2fF2% 20floating% 20point% 20call% 20causes% 20hard% 20fault & FolderCTID = 0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B & currentviews = 398 – rost0031
Ma compréhension est que le cortex-m3 n'a pas de fpu. https://en.wikipedia.org/wiki/ARM_Cortex-M –