Hi Martin,
There is bug in the fsl_debug_console.c (look below for "//DES" comment).
static int32_t DbgConsole_ConvertFloatRadixNumToString(char *numstr,
void *nump,
int32_t radix,
uint32_t precision_width)
{
int32_t a;
int32_t b;
int32_t c;
int32_t i;
uint32_t uc;
double fa;
double dc;
double fb;
double r;
double fractpart;
double intpart;
int32_t nlen;
char *nstrp;
nlen = 0;
nstrp = numstr;
*nstrp++ = '\0';
r = *(double *)nump;
if (!r)
{
*nstrp = '0';
++nlen;
return nlen;
}
fractpart = modf((double)r, (double *)&intpart);
/* Process fractional part. */
for (i = 0; i < precision_width; i++)
{
fractpart *= radix;
}
if (r >= 0)
{
fa = fractpart + (double)0.5;
if (fa >= pow(10, precision_width))
{
fractpart++; //DES was intpart++;
}
}
else
{
fa = fractpart - (double)0.5; //DES???
if (fa <= pow(-10, precision_width))
{
fractpart--; //DES was intpart--;
}
}
Please see solution on this post: PRINTF in KDS
Regards,
David