# Forum: ARM programming with GCC/GNU tools STR9 and floating point printf

 Author: Dave S. (daverm) Posted on: 2008-12-09 18:13

Rate this post
 0 ▲ useful ▼ not useful
Hi,

The problem I am having is similar to other forum threads such as
"Floating point with sprintf / vsprintf"

I'm attempting to use floating point printf but I get non-number ASCII
characters in the output which turn up in the same spots for certain
numbers.  (ie. 1.1111@. Actually the @ is really ASCII character 001 but
since I can't show ASCII character 001 here I'll use '@' to represent
it).
I am using WinARM version 20060606 which I believe is compiled for
'hard-float'. And as I've learned on this forum (thank you) that even
though the library is compiled with floating point coprocessor opcodes,
the floating point opcodes are handled by an exception handler.
I'm got two 'sections' of compiled code, the OS code which is compiled
using IAR and the other 'dll' which is compiled using GCC. So I assume
the problem might be the fact that the floating point exception handler
is compiled using IAR and the calling code is in GCC. However, I can't
seem to find the exception handler in order to debug it.

I've tried switching to the "arm-2008q1-126-arm-none-eabi" toolchain,
which I believe is compiled with "soft-float", but it causes a data
abort exception when it prints the float.

Is there an incomaptibility between arm-none-eabi code and the IAR code?
The only thing I haven't tried is recompiling the arm-elf toolchain with
'soft-float' but that is a last resort since it is very cclose to
working except for the odd odd character in the output.

Thx, Dave

 Author: Joel J. (jomed) Posted on: 2008-12-10 08:23

Rate this post
 0 ▲ useful ▼ not useful
Dave,
I am just facing the same issue since a long time.
I have tried several Gcc tool chaine for my STR912 ev board, all failed
with floating point except Idealist tool chain that is the only tool
chain that process and format floating point in the right way for my
project/MCU.
I will follow up your post like every post related to this topic.
Good luck,
Joel

Dave Schmeltzer wrote:
> Hi,
>
> The problem I am having is similar to other forum threads such as
> "Floating point with sprintf / vsprintf"
>
> I'm attempting to use floating point printf but I get non-number ASCII
> characters in the output which turn up in the same spots for certain
> numbers.  (ie. 1.1111@. Actually the @ is really ASCII character 001 but
> since I can't show ASCII character 001 here I'll use '@' to represent
> it).
> I am using WinARM version 20060606 which I believe is compiled for
> 'hard-float'. And as I've learned on this forum (thank you) that even
> though the library is compiled with floating point coprocessor opcodes,
> the floating point opcodes are handled by an exception handler.
> I'm got two 'sections' of compiled code, the OS code which is compiled
> using IAR and the other 'dll' which is compiled using GCC. So I assume
> the problem might be the fact that the floating point exception handler
> is compiled using IAR and the calling code is in GCC. However, I can't
> seem to find the exception handler in order to debug it.
>
> I've tried switching to the "arm-2008q1-126-arm-none-eabi" toolchain,
> which I believe is compiled with "soft-float", but it causes a data
> abort exception when it prints the float.
>
> Is there an incomaptibility between arm-none-eabi code and the IAR code?
> The only thing I haven't tried is recompiling the arm-elf toolchain with
> 'soft-float' but that is a last resort since it is very cclose to
> working except for the odd odd character in the output.
>
> Thx, Dave

 Author: Dave S. (daverm) Posted on: 2009-01-27 16:29

Rate this post
 0 ▲ useful ▼ not useful
Joel,

I found the problem with my printf displaying odd characters. It turns
out it was an errata with the STR9 part not able to address single bytes
properly on the EMI bus.

Hope this helps.

Dave

Joel Jomed wrote:
> Dave,
> I am just facing the same issue since a long time.
> I have tried several Gcc tool chaine for my STR912 ev board, all failed
> with floating point except Idealist tool chain that is the only tool
> chain that process and format floating point in the right way for my
> project/MCU.
> I will follow up your post like every post related to this topic.
> Good luck,
> Joel
>
>
> Dave Schmeltzer wrote:
>> Hi,
>>
>> The problem I am having is similar to other forum threads such as
>> "Floating point with sprintf / vsprintf"
>>
>> I'm attempting to use floating point printf but I get non-number ASCII
>> characters in the output which turn up in the same spots for certain
>> numbers.  (ie. 1.1111@. Actually the @ is really ASCII character 001 but
>> since I can't show ASCII character 001 here I'll use '@' to represent
>> it).
>> I am using WinARM version 20060606 which I believe is compiled for
>> 'hard-float'. And as I've learned on this forum (thank you) that even
>> though the library is compiled with floating point coprocessor opcodes,
>> the floating point opcodes are handled by an exception handler.
>> I'm got two 'sections' of compiled code, the OS code which is compiled
>> using IAR and the other 'dll' which is compiled using GCC. So I assume
>> the problem might be the fact that the floating point exception handler
>> is compiled using IAR and the calling code is in GCC. However, I can't
>> seem to find the exception handler in order to debug it.
>>
>> I've tried switching to the "arm-2008q1-126-arm-none-eabi" toolchain,
>> which I believe is compiled with "soft-float", but it causes a data
>> abort exception when it prints the float.
>>
>> Is there an incomaptibility between arm-none-eabi code and the IAR code?
>> The only thing I haven't tried is recompiling the arm-elf toolchain with
>> 'soft-float' but that is a last resort since it is very cclose to
>> working except for the odd odd character in the output.
>>
>> Thx, Dave

 Author: Joel J. (jomed) Posted on: 2009-01-30 14:00

Rate this post
 0 ▲ useful ▼ not useful
Dave,
If you have a simple project that just format a float in a string, could
you pass it to me (with the makefile)?
Joel

Dave Schmeltzer wrote:
> Joel,
>
> I found the problem with my printf displaying odd characters. It turns
> out it was an errata with the STR9 part not able to address single bytes
> properly on the EMI bus.
>
> Hope this helps.
>
> Dave
>

 Author: Dave S. (daverm) Posted on: 2009-01-30 15:47

Rate this post
 0 ▲ useful ▼ not useful
Joel,
I should have mentioned that I fixed the problem by using the internal
RAM whereas before I was using external memory in an FPGA on the EMI
bus.
Therefore it has nothing to do with the makefile and more to do with the
-Dave

Joel Jomed wrote:
> Dave,
> If you have a simple project that just format a float in a string, could
> you pass it to me (with the makefile)?
> Joel
>
> Dave Schmeltzer wrote:
>> Joel,
>>
>> I found the problem with my printf displaying odd characters. It turns
>> out it was an errata with the STR9 part not able to address single bytes
>> properly on the EMI bus.
>>
>> Hope this helps.
>>
>> Dave
>>

• Post long source code as attachment, not in the text

### Formatting options

• [c]C code[/c]
• [avrasm]AVR assembler code[/avrasm]
• [code]code in other languages, ASCII drawings[/code]
• $formula (LaTeX syntax)$
 Name: E-mail address (not visible): Subject: Searching for similar topics... Attachment: Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one. Text: