This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]