I am trying to get char data out of our 6713 target , for both the simulator and real target HW case. Right now i'm working with the simulator. Essentially I want to print out a variable char string to a file. I have successfully linked in the DSP/BIOS LOG module that allows me to call LOG_printf(), but as i discovered later, this only supports printing constant strings, and i was getting an error of the format *** ERROR: 0x%x 0x%x ***\n in place of the desired sting. The code snippet below shows how i managed to get single char data from the variable string printed to a file, where "s" is a pointer to a variable char string.
print_string_to_file( char *s) {
int i, len;
len = strlen(s);
for( i=0; i<len; ++i ) {
LOG_printf(&trace, "%c", s[i]);
}
}
I specified the output file by editting the properties of the Message Log window in the debugger to point to a file named stdout.txt. This file then contains char data with a single char on a line followed by a new line '\n' that i assume gets appended for each call to LOG_printf().
So is there a better, easier way to print a variable char string to a file? can i use a printf(), fprintf() or SYS_printf instead? Also, is there a means to specify what that file name is, (thru some scripting method?), that i currently must do manually inside the IDE via Message LOG properties?
thanks for any advice ....