AnsweredAssumed Answered

fgetc halting MQX

Question asked by Angelo Quattrociocchi on Mar 26, 2011
Latest reply on Mar 28, 2011 by Haihang Sun

I'm having a strange problem where certain received characters are causing my program to halt.  The code has been working very nicely, but I started to receive conditions that caused this problem, which I believe I've narrowed down to the fgetc command.  The relevant snippets are below.  This receives all other characters OK, but when a 0x13 character is received execution stops at the fgetc line.  I don't see the significance of 0x13. I realize it has significance in relation to interrupt vectors on x86 based processors, but I can't imagine it's related to that.

 

The UART is connected to a peripheral that sends a variable data stream and I haven't tried to simulate all other input characters yet, but it has had no trouble with every other character the peripheral has sent, from 0x00 to 0xFF and many in between.  So far this (0x13) is the only character it seems to have a problem with.

 

Any thoughts?

 

Thank you,

Angelo

 

 

char c;
FILE_PTR fh_ptr = NULL;

fh_ptr = (pointer) fopen("ttyb:", (pointer) (IO_SERIAL_XON_XOFF));

do {   if (fstatus(fh_ptr)) {      c = fgetc(fh_ptr);      printf("%02X", c);   }
} while (...)

 

 

 

 

Outcomes