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.

CToolsLib

Hi,

I have one question for CToolsLib.

Device is DRA7xx processor.

When I would like to use the CToolsLib for DRA7xx, Should I implement its source code into the DRA7xx code?

Or is it possible to implement CTools lib's source code to  a part of the OS?

Please advise me.

Best regards,

Michi

  • Hi Michi, 

    It depends on what you want visibility to and how your system is structured. Will need a bit more information to provide a good answer.

    1. Which CToolsLibs are you interested in integrating?
    2. Are you running Linux on the A15s or an RTOS?  
    3. I am not familiar with “DRA7xx code” so would need to know if the code is running on the A15 or DSPs.
    4. If the “DRA7xxx” code (or a component of the code) is running on the A15’s, is it running as a Linux user mode application?  

    Regards,

    Doug Deao

    Texas Instruments

  • Dear Doug-san,

    Thank you for your reply.

    Please see my answer to your questionnaire.

    1.Which CToolsLibs are you interested in integrating?

    -> I think AETLib, ETMLib and ETBLib. Probably alomost is Core Trace module.

    2.Are you running Linux on the A15s or an RTOS?  

    ->  It is not Linux. It is WEC9(Windows Embedded Compact) OS.

    3.I am not familiar with “DRA7xx code” so would need to know if the code is running on the A15 or DSPs.

    -> The code is running on the A15 core.

    4.If the “DRA7xxx” code (or a component of the code) is running on the A15’s, is it running as a Linux user mode application?  

    -> It is not Linux OS. It is WEC9. Windows has two modes. One is kernel mode. And other one is user mode. I don't know well WEC9 OS. But I think OS's core components is running with kernel mode, and application is running with user mode.

    I appreciate your support.

    Best regards,

    Michihiro

  • Michi-san,

    AETLib and DSPTraceLib must be integrated into the DSP code (for PC core trace). The AET registers are not mapped external to the DSPs.

    For Linux, ETMLib supports tracing the kernel execution space, but not user mode programs. So I would think the same would apply to WEC9. If the MMU is used to swap memory space for the current user space application with WCE9, it will present the same problem and the trace data will not be decodable by TI’s td.exe utility if you trace outside the kernel's execution space (assuming WCE9 works like Linux and always keeps a copy of the kernel in the current MMU page). So for ETMLib you may need to integrating it as a WCE9 kernel module that traces just the kernel space (in a PC range).

    Since DRA7xx only has a single TBR (Trace Buffer)  you will probably want to integrate ETBLib into your A15 code. The TBR will format the data such that multiple sources of trace data can be captured simultaneously, so it makes sense to not tangle up the trace source and capture programming (unlike our bare-metal examples provided withthe libraries). For the Linux port of ETBLib (see code at #ifdef __linux in ETBLib source – TIETB.c), ETBLib uses an external function to map the TBR control registers to user space (cTools_memMap and cTools_memUnMap). If you provide those two functions, and modify the #ifdef __linux to something appropriate for WEC9, ETBLib should work. ETBLib has the capability built in to drain the TBR contents (ETB_read function), and you will probably want to store the drained trace data in a file. Thus you may have to wrap ETBLib in a user mode application (in Linux you have to do this because you can’t access the file system from the kernel).

    For Linux we generally have to touch the kernel to make the L3_INSTR memory space (or at least the CT_TBR space) mappable for user mode applications (may require a device driver).  Also, in ETBLib there is code to enable power for the DebugSS (module that contains the CT_TBR). If you integrate ETBLib into a user mode application you will want to recompile ETBLib with the “NO_PSC” pre-defined symbol. And then modify the kernel to power-up the DebugSS if it is not already being powered up.

    To get good trace data captured with the TBR, prior to draining the trace data from the TBR, you must stop DSP and A15 core trace on demand through library calls or with triggers to end trace generation (setup with library calls).

    Regards,

    Doug Deao