Dear SupporTeam,
inline
std::string FormatLogString(const CHAR* format, ...)
{
const INT32 ZERO = 0;
std::string strLog = "FORMATTING ERROR !\n";
va_list args;
va_start(args, format);
CHAR formattedMsg[GCProtocol::MAX_LOG_MSG_STRING_SIZE];
INT32 result = vsnprintf(formattedMsg,
GCProtocol::MAX_LOG_MSG_STRING_SIZE,
format,
args);
if(ZERO < result)
{
strLog = formattedMsg;
}
va_end(args); /*TICS !OAL#015 allow null for logging*/
return strLog;
}
We use above function for var arg formatting
we have a situation where A2D values fluctuates at a boundary and causes inRange and outRange using %f value(position in cm e.g. 10.2 ) getting logged using above function. We read the A2D count value periodically from two tasks; because of the fluctuation we see inRange and outRange getting logs periodically. We observed stack overflow in this situation and if we get rid of logging %f value, it works fine. we have so many other instances where we log using %f but we don't see any issue.
BTW, we don't log directly from our TIVA C base board; our logger utility will send string to our master board which supports logging.
ccs - 901
compiler version - TI v18.12.1.LTS
tirtos_tivac_2_16_00_08
Any clue?
Thank you.
Abhijit