After hours debuging an inexplicable error, I finally found the inexplicable solution .
Code #1
void HexToCoord (bool LatLon1, s32 Coord1, ascii * pRetCoord)
{
ascii buffer1[15]; // ascii located here generates the error.
ascii pSignal[3];
s32 Deg1=0;
s32 Min1=0;
s32 MMM1;
// Mycode
// First occurrence of "buffer1"
wm_sprintf(buffer1,"%02lu", Min1);
// Rest of the code
}
Debug mode: works fine!
Compiled in GCC: Generates the error:
“Error: byte or halfword not valid for base register – strb r3,[sp]' byte or halfword not valid for base register --
strb r3,[sp,#1]’”
After changing the position of the first “ascii” to:
Code #2
...
ascii pSignal[3];
s32 Deg1=0;
s32 Min1=0;
s32 MMM1;
ascii buffer1[15]; // New location
...
Debug mode: works fine!
Compiled in GCC: works fine!
It is really a strange behavior.