This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SYSBIOS 6.33.6.50 - vsprintf use - prints garbage

Other Parts Discussed in Thread: SYSBIOS

Processor: c6657 using PDK 2.1.1.4

I am trying to use my own print function to send character string to destination Host processor from DSP. 

For now my function is very simple:

main()

{

st_dpf("testp_sub(%d, %d, %d, %d, %s, %d)\n", nMsgs, nBytes, nb, quiet, diag, wrsel);

}

void st_dpf(const char *fmt, ... )
{
va_list arg_ptr;
uint32_t i, length;

/* Initial platform_write to temporary buffer.. at least try some sort of sanity check so we don't write all over
* memory if the print is too large.
*/
if (strlen(fmt) > MAX_WRITE_LEN) {/* platform_errno = PLATFORM_ERRNO_INVALID_ARGUMENT;*/ return;}

va_start( arg_ptr, fmt );
length = vsprintf( (char *)write_buffer, fmt, arg_ptr );
va_end( arg_ptr );

for (i=0; i < length; i++)
{
(void) platform_uart_write((uint8_t)write_buffer[i]);
}
return;
}


{ à|Ixwë@ýÈ¥4ÐJHh.y> ..<]ï¢î
{ wë@ýÈ¥4ÐJHh.y> ..<]ï¢î|Ix¡P®5¤F#$iGkÊBâ^?qZ
{ wë@ýÈ¥4ÐJHh.y> ..<]ï¢î|Ix¡P®5¤F#$iGkÊBâ^?qZ
{ wë@ýÈ¥4ÐJHh.y> .. à|Ix¡P®5¤F#$iGkÊBâ^?qZ
retval=0 (0x00)

This prints on UART console all Garbage. 

When I set a breakpoint at the entry of the st_dpf(), the fmt does not contain the arguments I am sending. 

Added a power point presentation on this problem we analyzed. The crash comes because of invalid pointer access 0x00000001. 

5483.st_dpf.ppt

Not sure exactly which group this problem belongs. We start with sysbios.