cancel
Showing results for 
Search instead for 
Did you mean: 

Why is printf not working with floating point on the STM32F407VG, IAR 8.30.1

km shim
Associate II

ex) When compiled with IAR 8.30.1, HardFault exception was occured.

float gfSetDataRate = 100.0f;
printf("Data Rate = %f \r\n", gfSetDataRate);

HardFault is occured at VCVT.F64.F32 instruction.

I also tested following case

  1. In case Compiled with GCC, is working well.
    1. Other device STM32F411, Working well with IAR, GCC.

What is wrong? IAR, my source, STM32F407 FPU?

Ggive me any other hints, please.

12 REPLIES 12
AvaTar
Lead

According to the ARM infocenter site (http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0553a/CHDJAEDB.html), F64 is not a valid datatype for the M4 VCVT instruction.

AvaTar
Lead

You found it yourself in the meantime...

I would guess the offending instruction is legal in ARM mode (not thumb 2), or supported with double precision FPUs.

km shim
Associate II

AvaTar​,

Thank you very much.