From: Sussch on 17 Feb 2010 09:00 >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 > > I'm having a similar problem on LM3S9B92-EK. I'm using GNU Arm toolkit configured with the '--with-float=soft' option. The project is compiled with -mthumb (Thumb-2), -msoft-float (Software floating point emulation), -mcpu=cortex-m3 (Cortex-M3 architecture) and a few other flags. I'm linking it against libdriver and libgcc (the one that's installed into the thumb subdirectory). Mine crashes (HardFault) on a simple comparison of 2 floats: float a = 1.2f; float b = 1.1f; UARTprintf ("\nLess %d..\n", (a < b)); And I'm pretty sure that the UART printout is working correctly.. Well, I doubt it's newlib - I could be wrong, but I guess that libgcc should contain software floating point emulation code. I'm a bit doubtful in the linker script that I wrote, because none of the supplied scripts linked without errors. Another suspicion would be the startup_gcc.c file, which I haven't modified much (due to the lack of working float sample code). Or, it could actually be a bug in the libgcc.. .. Tried to keep a long post short =P. All suggestions are welcome, Thank You --------------------------------------- Posted through http://www.EmbeddedRelated.com
From: Sussch on 23 Feb 2010 06:47 >>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 >> >> > >I'm having a similar problem on LM3S9B92-EK. I'm using GNU Arm toolkit >configured with the '--with-float=soft' option. The project is compiled >with -mthumb (Thumb-2), -msoft-float (Software floating point emulation), >-mcpu=cortex-m3 (Cortex-M3 architecture) and a few other flags. I'm linking >it against libdriver and libgcc (the one that's installed into the thumb >subdirectory). > >Mine crashes (HardFault) on a simple comparison of 2 floats: >float a = 1.2f; >float b = 1.1f; > >UARTprintf ("\nLess %d..\n", (a < b)); > >And I'm pretty sure that the UART printout is working correctly.. > >Well, I doubt it's newlib - I could be wrong, but I guess that libgcc >should contain software floating point emulation code. > >I'm a bit doubtful in the linker script that I wrote, because none of the >supplied scripts linked without errors. Another suspicion would be the >startup_gcc.c file, which I haven't modified much (due to the lack of >working float sample code). Or, it could actually be a bug in the libgcc.. > >. Tried to keep a long post short =P. > >All suggestions are welcome, >Thank You > > > >--------------------------------------- >Posted through http://www.EmbeddedRelated.com > Well, as it turned out, libgcc had been configured wrong (for ARM7TDMI). I had to configure gcc with this: --target=${GCC_TARGET} --prefix=${ARMTOOLS} --enable-interwork --enable-multilib --enable-languages="c,c++" --with-newlib --with-headers=../../src/newlib-${NEWLIB_VERSION}/newlib/libc/include --with-float=soft --with-cpu=cortex-m3 --with-tune=cortex-m3 --with-mode=thumb --disable-libssp where NEWLIB_VERSION=1.18.0 GCC_TARGET=arm-none-eabi and ARMTOOLS=/usr/local/arm Hope this helps.. --------------------------------------- Posted through http://www.EmbeddedRelated.com
|
Pages: 1 Prev: %%% top 10 Lovely place for Lovers %%%% Next: bluetooth + embedded system |