ARM Technical Support Knowledge Articles

PRINTF OUTPUTS 0.000000 FOR FLOAT VARIABLES

Applies to: RealView C Compiler

Answer


Information in this article applies to:


QUESTION

I am using the RTX Kernel in my project. When I use printf (or a derivative such as sprintf, snprintf) in my source code together with float number, the only 0.000000 is printed.

What can be wrong?

ANSWER

This problem is caused by a mis-aligned stack (R13) register at the start of the task. It is important that the stack is 8-byte aligned.

Most likely you have an older version of the RTX_CONFIG.C file. Make sure that include a current version of the RTX_CONFIG.C file in your project.

Another reason for this problem might be that you have used the function os_tsk_create_user_ex or os_sys_init_user with an stack that is not 8-byte aligned.

MORE INFORMATION

ATTACHED FILES

Request the files attached to this knowledgebase article.

Article last edited on: 2007-12-11 08:24:01

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential