This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
MPC860 - getchar/scanf issue
- From: nprasad3 at gmu dot edu
- To: ecos-discuss at sources dot redhat dot com
- Date: Mon, 29 Dec 2003 18:24:53 -0500
- Subject: [ECOS] MPC860 - getchar/scanf issue
Hi,
I am using a confuguration that utilizes the SCC1 for a serial connection and is supposed to be the console and I really need getchar/scanf functionality in my application.
Testing with the following problem, getchar/scanf doesn't seem to work reliably.
-------------------------------------------------------------
#include <stdio.h>
int main(void)
{
char ch;
printf("Hello, eCos world!\n");
/*-- input test --*/
for(;;)
{
ch = getchar();
printf("[ch] = %c\n",ch);
}
return 0;
}
-----------------------------------------------------------
Here's the terminal output:
RedBoot> go
Init device '/dev/ttydiag'
Init tty channel: 3
Init device '/dev/haldiag'
HAL/diag SERIAL init
Hello, eCos world!
<waits here>
abcd<cr-lf> (each character requires to be hit about 10-15 times after which it shows up)
[ch] = a
[ch] = b
[ch] = c
[ch] = d
[ch] =
-------------------------------------------------------------
Any ideas on what is wrong and where I need to start looking?
Thanks
Nirmal
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss