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.

Stock example of LOG_printf() writes incorrectly to trace$buf

Other Parts Discussed in Thread: CCSTUDIO

Hi,

Thanks for reading.

I copied and ran c:\CCstudio_v3.1\examples\sim64xx\bios\quetest\quetest1.pjt

I open view->memory at location trace$buf and saw this:

trace$buf

0000D000 ............|$..

0000D010 ....a.......'$..

0000D020 ....b.......'$..

0000D030 ....c.......'$..

0000D040....d........'$..

 

It should say, "writing a", "reading a", etc.

 

Any clue whats wrong with LOG_printf?

 

-jim

 

  • Found it myself. Thanks ti-wiki !

    http://www.tiexpressdsp.com/index.php?title=Accessing_DSP_BIOS_logs_without_JTAG

    I was looking at memory as "char".

    If instead I had done TI-32bit, I might have reverse engineered it lone-sef !

    Log_printf() puts out encrypted message as follow:

    sequence number, arg0, arg1, then address of the guts.

    Silly me thought it was just a simple string. (actually I like TI method better.)

    ------Anyone got INTEL code to pull LOG_printf() message out somehow???---------------

    email me if you do....

    -jim

    gpscruise@gmail.com

     

  • Hi Jim,

    I am curious about why you need to change the way the LOG message sits in memory? The point of the LOG_printf() is to output a message to the Message Log window inside CCS (basically a less invasive version of printf()). I don't think the way LOG_printf works can be changed.

  • Log_printf() puts stuff in trace$buf.

    I want to copy trace$buf to another area and customize it there.

    Q: How do I get the address of trace$buf in C, not assembly?

    It isn't

    _trace$buf

    so I can't call it from C.

    There is no underscore.

     

  • Because it lacks the leading underscore it cannot be accessed through C, only Assembly.

  • Where is the C6x assembly manual online?

    Heres what I have so far.  My assembly is rusty...

    //implementing           myframebuf= frame$buf

    asm(".global frame$buf");

    asm(".global _myframebuf");

     

  • j p said:

    Where is the C6x assembly manual online?

    What processor are you targeting?  Go to the Product Folder for the specific process on http://www.ti.com.  You should find an User's Guide called DSP CPU and Instruction Set Reference Guide for the instruction set.

    However, I believe you are looking for the assembly tools manual.  If so, this document should be included in the CCS installation directory on your PC.  For example, in the C:\CCStudio_v3.3\docs\PDF\manuals_ccs_full_c6000.html

  • Got it, thanks.   C6416   spru189f.pdf

    //this creates a C pointer to the ASM trace$buf    Used to read LOG_printf() results from C.

    int mytracebuf;

    main() {

    asm(" .global trace$buf");

    asm(" .global _mytracebuf");

    asm(" mvkl trace$buf,a1");

    asm(" mvkh trace$buf,a1");

    asm(" mvkl _mytracebuf,a2");

    asm(" mvkh _mytracebuf,a2");

    asm(" stw a1,*a2");

    }

    thanks. I will mark this closed, unless you see any gotchas in my inline-asm code...

    -jim