This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
printf problem in twothreads sample
- From: Rod Campbell <rodc at sigmaelectronics dot com>
- To: ecos-discuss <ecos-discuss at sources dot redhat dot com>
- Date: 27 Jun 2003 18:23:17 -0400
- Subject: [ECOS] printf problem in twothreads sample
- Organization: Sigma Electronics
I am new to eCos and am using version 2.0b1. I created redboot and
installed it on my target (a Hitachi SH3 7729RSE01 Solution Engine). I
had some minimal customization to do to get it working - I started with
the stock eCos 7709SE01 template and had to change the clock rate parm,
fix some FRQCR generation register code and some code to get flash file
support working.
Using my Redboot, I can download the sample programs (after compiling
with the eCos libraries generated from the "default" version of my
template in the Config tool). However, when the sample program includes
a printf that has parameters (%d) in it, like in twothreads.c, the
program loops, continually printing out ascii zeros in the Insight
debugger's console window.
Printf with only static string data (i.e. printf("Hello world.\n"));
works fine. Also, if I use diag_printf instead, the correct console
output is seen and the program runs successfully.
When I step through the program, the failure is in vfnprintf.cxx,
function vfnprintf(). After parsing and finding the "%" in the format
string, a line in the assembler code in vfnprintf() produces signal
SIGILL, Illegal instruction. I wonder if this is a problem with code
over-optimization? I also wonder if the problem I'm seeing with printf
is a symptom of some larger problem with the eCos code I generated for
this platform with the config tool?
Thanks for any insights.
Rod Campbell
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss