2013-01-21 11:32 PM
Hi,
I am using STM32f4discovery board and am trying to write a code which will take moving average of accelerometer data. For this purpose my average variable have to be in floating point. But during initialization when my code reaches to the following statement avgx = 0.0; the processor ends up in hard fault handler. Now as Discovery board supports floating point processing I am assuming that I have missed enabling it in Keil. So i have added '--fpu' to assembler flags but now during linking I get this error startup_stm32f4xx.s: error: A3903U: Argument '-I' not permitted for option 'fpu'. Can anyone help me to how to enable it i.e which assembler directives do I have to do this Regards #stm32f4-discovery-fpu2013-01-22 12:32 AM
Project Options -> Target -> Floating Point Hardware -> Use FPU
You must then have code to enable the FPU hardware prior to using any FPU instructions. This is typically in the ResetHandler or SystemInit() system_stm32f4xx.cvoid SystemInit(void)
{
/* FPU settings ------------------------------------------------------------*/
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2)); /* set CP10 and CP11 Full Access */
#endif
...
2013-01-22 10:11 AM
Thanks clive1 that worked perfectly
2014-05-10 09:36 AM
Sir,
I am using STM32F4 Discovery I am having problem with it when ever I connect it with USB through PC it does not show SWD and JTAG and its LD1 remains green and its IC for debugging becomes very hot. Even if I connect it with external supply this IC STM32F103C8T6 becomes very hot. Before this it was working properly. Last time when it started this behavior I was debugging my code.