lpcware

Error when printing a float ( HardFault_Handler)

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by kemes on Sat Apr 06 07:42:48 MST 2013
Hi to all
I am using LPC11U37/401 with LPCXpresso v5.1.2 [Build 2065] [2013-02-20] with newlib.
When I attempt to use sprintf with a float I obtain an HardFault Handler.  here is the code:

float   Temp= 0;
char actTemp[128];

    sprintf(actTemp,"%4.2f",Temp[0]);

no change if I use newlib in nohost or semihost.  How can I solve ?
(All ok if I attemp to print a decimal, that is sprintf(actTemp,"%d",value); )
Thanks

Outcomes