[ECOS] MPC860 - getchar/scanf issue

nprasad3@gmu.edu nprasad3@gmu.edu
Tue Dec 30 08:16:00 GMT 2003


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



More information about the Ecos-discuss mailing list