AnsweredAssumed Answered

MC9S08QG8 and strange reset while debugging

Question asked by Alejandro Bermudez on Aug 4, 2008
Latest reply on Aug 4, 2008 by Alejandro Bermudez

I've been getting a strange reset. Here is when it happens:

From the main I'm calling ejectarea():

void ejectarea(void){ byte categ;  byte tarea;    categ = concatenar(msgTipRcv[0], msgTipRcv[1]);  tarea = concatenar(msgRecRcv[0], msgRecRcv[1]);...

The program does the first concatenar() but the reset ocurrs in the second.

concatenar() has:

byte concatenar(char char1, char char2){ byte num12;  char char12[2] = "";     char12[0] = char1;  strcat(&char12, &char2);  num12 = atoi(&char12);

The reset ocurrs inside strcat() (of string.c) at this part of the code:

LIBDEF_StringPtr strcat(LIBDEF_StringPtr str_d, LIBDEF_ConstStringPtr str_s) {  LIBDEF_StringPtr sd = str_d;  str_d += strlen(str_d);  while(*str_d++ = *str_s++) {}  return (sd);}

before the reset.

Screenshot after the reset.

It says: "Error: Unable to go into background mode."

Not sure if it is due to the debugger or what but the hardware is not working well and the only way to check for errors is debuggin the code.

Any ideas?

Thanks a lot