Error: 10
Brought to you by:
fwornle
Sir,
I have a new issue that I'm dealing with. It appears that my serial receive has stopped working and I'm unsure why. Now whenever I try to receive data "Error: 10" displays on the the LCD. I was wondering if you had a little more information regarding Error: 10. As usual any help is greatly appreciated.
Tim
Tim,
This could be for a few reasons... when I designed the first edition of this toolbox, there was no LCD display on the evaluation board I used. So, in order to display error messages, I used a simple LED - which I had flash in different patterns. The function call "abort_LED(10)" caused the LED to flash once (for 1), short pause, no flash (for 0), pause... thus indicating "error 10". When the LCD display become available, I simply replaced this routine by one that displayed the error on the display.
Now, searching for "abort_LED(10)" you find multiple instances of this function call... my guess is, this is a "memory overflow". Try modifying file ".../mc/core/mc_buffer.h" which features the definition for macro "BufferSet":
#define BufferSet(BPtr,val) \ if(NotFullBuffer(BPtr))\ {\ BPtr->buf[BPtr->head] = val;\ BPtr->head = IncCount(BPtr->head,BPtr->bufLength);\ BPtr->byteCount++ ;\ }\ else\ {\ abort_LED(10);\ }
If you replace the "10" by any other number (eg. "42"), the error should change to this number. Should this happen, you'll have to find all occurrences of where this macro is used (.../mc/core/mc_freePortComms.c and, if you are using the External Mode interface, .../ml/rtw/c/src/ext_mode/serial/ext_serial_9s12_port.c). Then try to find out why the buffer overruns - generally, this happens when running a FreePortComms block at too fast a rate or when producing too much upload data for the serial line to cope (ExternalMode).
F.