From: frikkiethirion on
Good day,
I'm running GCC 4.4.2 (newlib 1.17) cross compiled for target:
arm-none-eabi under Linux.
I'm testing my small application under QEMU: qemu-system-arm -M lm3s811evb
and
use Eclipse/GDB to debug the application.

I've run into a problem where floating point arithmetic causes the chip to
crash. GCC was compiled with the "soft-float" option. My application is
also compiled with the "soft float" option and linked against the math
library (-lm).

The piece of offending code is:
fTmp += 3.0;
The disassembly is:
d24: 6b38 ldr r0, [r7, #48]
d26: 492a ldr r1, [pc, #168]
d28: f000 ec32 blx 1590 <__addsf3>
d2c: 4603 mov r3, r0
d2e: 633b str r3, [r7, #48]
Eclipse opens the file: ieee754-sf.S and focus on Line 68:
ARM_FUNC_START addsf3

Will there be any specific reason why this helper function may cause the
chip to crash?
Could it be a case of QEMU not simulating the ARM behavior properly?

Any help will be much appreciated
Regards,
Frikkie Thirion

---------------------------------------
This message was sent using the comp.arch.embedded web interface on
http://www.EmbeddedRelated.com
From: Anders.Montonen on
frikkiethirion <frixmail(a)gmail.com> wrote:
> Eclipse opens the file: ieee754-sf.S and focus on Line 68:
> ARM_FUNC_START addsf3
> Will there be any specific reason why this helper function may cause the
> chip to crash?

The Cortex-M3 supports only the Thumb-2 instruction set, calling an ARM
function will cause an Usage Fault. I'm guessing there's a compiler/linker
flag missing in your setup, or some bug in newlib's build process.

-a