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.

how do you add Log_Events to the HelloWorld SYS/BIOS sample project

I want to add 4 LoggerBufs to the HelloWorld SYS/BIOS sample project.  Here are my assumptions: write to separate LoggerBuf's by using Log_Writex, instantiate each format string as a Log_Event and store the Log_Events in the project's xdc file.  Are my assumptions are correct?  I don't understand how I add an .xdc file to HelloWorld in CCS5.0.2.

  • I think you actually want to be looking at the Log_infoX APIs. With these, you just pass the format string at the call site.

    Also, the LoggerBuf instances work differently than I think you might be thinking. You don't pass a LoggerBuf instance handle to the Log APIs; instead, you associate a LoggerBuf instance with a module, and then all Log calls made in the context of that module will go to that LoggerBuf.

    Take a look at the following article, I think it may be a good place to start:

    http://processors.wiki.ti.com/index.php/Adding_RTA_to_Your_BIOS_6_Application

    Thanks,

    Chris

  • Chris:

    Thanks that tutorial was helpful.  In the case where I still want to use Log_writex, how do I add Log_Events to a program?

    Neil

  • In order to define a Log_Event, you would need to write a RTSC module. This involves defining a RTSC package, and your RTSC module, and then building that package. I'm not sure that CCS has any tools for helping you build RTSC content, but I will ask someone.

    Defining RTSC content is not usually undertaken by customers outside of TI, but it is possible and documented if you are brave enough :)

    http://rtsc.eclipse.org/docs-tip/RTSC_Programming

    The main advantage to using Log_Events over Log_print or Log_info is that the format string does not need to exist on the target. An event ID is logged that can be used to reference the format string from a separate meta data file. Is that why you were interested in it, or was there another benefit that you perceived?

    Thanks,

    Chris

  • Chris:

    Thanks to your help, I think I understand what I need to do.   At this point, I'm not brave enough to write my own RTSC module though!  You are correct that I am interested in formatting the log on the host.  I'm probably not going to go through the trouble of doing the RTSC package/module, unless you strongly recommend otherwise.  Instead, I'm going to create my own events numbers outside of RTSC and use my events as an index to format the logs on the host. 

    Neil

  • It's worth noting that when LoggerBuf is used in conjunction with ROV or RTA, the formatting of the printf strings IS done on the host, even when using the Log_info API. The only difference is that with Log_info, the format string must occupy memory on the target.

    So if you're only trying to avoid the overhead of printf formatting on the target, you don't need to worry about that. The formatting is done on the host.

    If you're trying to save on footprint, though, I think there may be some linker tricks we can recommend for preventing your format strings from being loaded onto the target.

    Thanks,

    Chris

     

  • For what it's worth, there's an example of adding a new module that defines events on the RTSCpedia: http://rtsc.eclipse.org/docs-tip/Using_xdc.runtime_Logging/Example_6

    It's not too bad, the files and the build are straight forward.  You just need to remember to put the package on your package path.