Skip to main content
km shim
Associate II
Oct 21, 2018 1:15 PM UTC
Question

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

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.

​

    This topic has been closed for replies.

    12 replies

    AvaTar
    Senior III
    Oct 22, 2018 10:25 AM UTC

    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
    km shimAuthor
    Associate II
    Oct 22, 2018 10:42 AM UTC

    AvaTar​,

    Thank you very much.