Other Parts Discussed in Thread: TMS570LS3137
Hi,
I want to print any message on the CCS console by loading a small program in TMS570LS3137 Controller and executing it using Emulator (Spectrum Digital XDS-220).
1. In Build settings -> ARM compiler -> Advanced options -> Library Function Assumptions, "Level of printf/scanf support required" is configured to "full"
2. In Build settings -> ARM linker -> Basic options, Heap size is configured to 0x800
3. In Debug settings -> program/memory load options, "CIO function use (requires setting a breakpoint)" option is enabled
4. In Build settings -> ARM compiler -> Include options, ""C:\ti\ccsv6\tools\compiler\arm_5.1.6\lib\src" is added in Include search path for visibility of TI library files
5. In linker command file (.cmd), .sysmem section is defined in RAM ( .sysmem : > RAM)
Code is as shown below :
#include <stdio.h>
void main()
{
printf("Hello World");
User defined code--
}
I am able to compile and load the code but unable to execute printf() function and display the message on console.
Able to step in printf() function & it is getting stuck at "__TI_file_lock(stdout);"
Please let me know how can I overcome this issue.
Below is the printf() function - TI library (for your reference)
_CODE_ACCESS int printf(const char *_format, ...)
{
va_list _ap;
int rval;
char *fptr = (char *)_format;
/*------------------------------------------------------------------------*/
/* The current thread in a multi-threaded application must protect access */
/* to stdout. In this case, stdout may be updated, so we must ensure that */
/* the local copy of stdout is flushed to shared memory before leaving the*/
/* critical section (invalidated if it is not modified). */
/*------------------------------------------------------------------------*/
__TI_file_lock(stdout);
/*------------------------------------------------------------------------*/
/* If the current stream is not associated with a file, return an error. */
/*------------------------------------------------------------------------*/
if (stdout->fd == -1)
{
__TI_data_synch_INV(stdout, sizeof(FILE));
__TI_file_unlock(stdout);
return (-1);
}
va_start(_ap, _format);
rval = __TI_printfi(&fptr, _ap, (void *)stdout, _outc, _outs);
va_end(_ap);
__TI_data_synch_WBINV(stdout, sizeof(FILE));
__TI_file_unlock(stdout);
return (rval);
}
Early response will be really helpful.
Thanks & Regards,
Satya Sudhir Sure