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.

TCI6638K2K: CTools_UCLib for TCI6638K2K Device

Part Number: TCI6638K2K
Other Parts Discussed in Thread: TCI6630K2L,

Hi,

I want to setup CTools_UCLib in my project.

I am currently using TCI6638K2K and as I understand from the documents, this device is supported by the library. "The cTools_UCLib is a library for Keystone family devices (C66xx, TCI66xx, 66AK2Hxx, 66AK2Exx and TCI6630K2L)"

However, there are no compatible example projects for the mentioned device. The only TCI6630K2L example project has been given for the TCI66xx device family.

 

Is there any other download links which have example projects for TCI6638K2K?


Or can I configure the TCI6630K2L project to get an example for TCI6638K2K?
If yes, how can I do it, which parts have to be reconfigured?

Thank you,

Best Regards! 

  • Hi and thank you for your question. 

    Unfortunately at this time there is little that we can do for K2K, please see: https://e2e.ti.com/support/processors/f/791/t/809582

    That said, the embedded debug support for K2K and K2H are similar and I think you should be able to make progress by using the K2H (C66AK2Hxx) libraries and Project in lieu of a K2K specific version. Please note that you can access the latest CToolsLib by installing a recent K2 Processor SDK (e.g. https://www.ti.com/tool/PROCESSOR-SDK-K2H).
     
    Let me know if there's anything else I can do.

    Thank you,
    --Jason

  • Hi Jason,

    I downloaded ctools_2_2_0_0 from https://www.ti.com/tool/PROCESSOR-SDK-K2H.

    I applied the instruction steps which is given below for 66AK2E device:

    TMS320C66AK2Exx:
    * Libraries to link: ctools_uclib.c66AK2Exx_elf, cpt.66ak2exx_elf, dsptrace.c66xx_elf, tietb.c66ak2hxx_c66x_elf, aetlib.l66_elf and stm.c66xx_elf
    * Compiler Pre-include flags: C66AK2Exx and _STM_Logging

    My sw applicaition is built without any error. However, when i tried to add

    "ctools_Result ctools_stat_prof_start ( uint32_t SamplingPeriod )" this function to start the statistical profiling.

    I faced off with these errors:

    undefined first            referenced
    symbol                        in file
    ---------                       ----------------
    cTools_memAlloc     C:/ti/ctoolslib_2_2_0_0/packages/ti/Ctools_UCLib/lib/ctools_uclib.c66AK2Exx_elf.lib<ctools_uclib_stat_prof.obj>
    cTools_memFree      C:/ti/ctoolslib_2_2_0_0/packages/ti/Ctools_UCLib/lib/ctools_uclib.c66AK2Exx_elf.lib<ctools_uclib_stat_prof.obj>

    error #10234-D: unresolved symbols remain

    What should i do to overcome these errors?

    Where "ctools_stat_prof_start" function is decleared?

    Thank you, Enes

  • Hi Enes,

    It may not matter for the purpose of this exercise, but you might want to use K2H (C66AK2Hxx) instead of K2E.

    As for your question: ctools_stat_prof_start is defined in ctools_uclib_stat_prof.c, but the error you are seeing is because "cTools_memAlloc" and "cTools_memFree" are not defined.   CtoolsLib consolidates management functions that might vary across OS or targets into an OS Abstraction Layer (OSAL).  That layer, described in ctools_uclib_osal.h (which is included by ctools_uclib_stat_prof.c) needs to created by the user.  ctools_uclib_osal.h only defines these as externs.  

    You might be able to find some sample implementations (e.g. from the SDK install: demos/image_processing/ipc_instrumentation/src/cToolsHelper.c), but ultimately do whatever works best in the environment you are using. 

    --Jason

  • Hi Jason,

    I competed the customization of Ctools_UCLib into my project.

    I am using ctools_stat_prof_start and ctools_dsptrace_init functions to drain the trace data to statistical profiling by using XDS560 Pro tracer.

    Even I execute these functions when my application runs, i couldn't find any data.

    As i understand, when i finished the collection of the data, i have to execute td.exe to decode dsp data into .bin format which file contains it, will be saved as XDS560_RecTraceData.bin.

    Then i have to execute bellow command in the Command Line

    td.exe -bin XDS560_RecTraceData.bin -app <out file> <trace_decoder_options> | trace_stat_profile.exe --func_input <.csv file name> [-delta <sampling period>]

    However, i couldn't see any data.

    Then, I tried the following instructions steps those are given from the below document:

    However, i couldn't find The Unified Breakpoint Manager (UBM) Plugin whether on the internet as in CCS as built-in.

    Then i followed the below steps. However, i couldn't execute the Trace Control, "Tracing is not supported" message is replied.

      

    I tried three different ways to capture these data by using XDS560 Pro tracer.

    What should i do to get statistical profiling data and visualize it in a graph as given above example?

    Enes,Thank you

  • Hi Enes,

    You can capture trace on-chip via an ETB or off-chip via a Pro Trace receiver.  It sounds like you have an XDS560 Trace Pro receier and would like to capture via that receiver.  In this case you would normally setup the trace job via CCS--but it seems like you are having some issues with that. 

    Can you please confirm which version of CCS and the emupack you are using?

    In recent verisons of CCS you can retreive this data by:

    1] Help->About Code Composer Studio  : From this window you should be able to determine the version of CCS you are using

    2] Help->About Code Composer Studio->Installation Details : From this window scroll down to "TI Emulators" and you should find the version of that here.  

    For reference, I just tried CCS 10.0.0.00010 w/ TI Emulators 9.1.0.00001 and was able to configure a trace job on K2K without issue.

    Note that in more recent versions the trace control that you want is accessed via "Tools->Hardware Trace Analyzer"->Custom Core Trace.   If you are seeing an option for "Trace Control" then you might want to consider installer a newer version of CCS.   

    thanks,

    --Jason

  • Hi Jason, 

    Yes, i want to collect the trace data to find statisitical profiling. I have XDS 560 PRO Tracer.

    I prepared CTOOLS_STAT_PROF_START, CTOOLS_DSP_INIT functions, and i can call them while the devices are running.

    However, I couldn't see any log or bin file those should have trace data.

    What should i do?

    How can call those functions?

    I am currently working with:

    Code Composer Studio Version: 10.1.1.00004

    TI Emulators 9.2.1.00042

    I also tried to see statistical profiling by using Tools > Hardware Trace Analyzer > Statistical Function Profiling.

    However, "Could not run analyzer on C66xx_0. Cause: There are not enough resources available" error message is replied.

    Thanks, Enes

  • Hi Enes,

    Regarding the '.bin file' :

    The .bin file does not get created by the ctoolslib library functions. There are two receiver models supported: onchip collection via embedded trace buffer (ETB) and offchip via pro trace receiver. The ETB has a variation where EDMA can be used to spool trace data from the ETB into memory that is mapped into the SOC.  

    In your case you are sending trace data off-chip, so the pro trace receiver would need to be configured and recording enabled--this is not something that can be done via library calls so you must do this via CCS.  CCS, in this case, is what would create a .bin/.tdf file.  

    Regarding the error you received when trying to invoke 'Statistical Function Profiling' : 

    The "There are not enough resources available" message is generated when CCS attempts to program on-chip resources and they are already in-use or reserved for use.  My suspicion is that you attempted to run "Statistical Function Profiling" after your target application had already reserved the resources (i.e. after making the ctoolslib library calls).  You can certainly try resetting the target and invoking "Statistical Function Profiling" from CCS before your application has a chance to run. 

    Alternatively, you might also want to try using "Custom Core Trace" instead of "Statistical Function Profiling" while leaving the ctoolslib calls in place in your application.  In this case you would still want to start recording prior to running your target application:

    1. Tools->Hardware Trace Analyzer->Custom Core Trace
    2. From "Custom Core Trace Configuration" window:
    1. Change "Transport Type" to Pro Trace and expand the "Receiver/Transport Settings"
    2. I would recommend that you leave the default settings here.  Side note:  Large buffer sizes tend to increase decode time expotentially, so beware of changing that setting.
    3. Click on "Advanced Settings"
    • From "Advanced Properties":
      1. Select the "MFENCE Workaround" entry and click the red "X" icon on the left side of the window
      2. Click "OK"
    • From the "Custom Core Trace Configuration" window: click "Start"
    • At this point the trace pro receiver will begin the calibration process which might take a minute or two the first time.  Once that is complete and a trace viewer is open you can run your target application.

    thanks,

    --Jason

  • Hi Jason,
    Thank you for your rapid responses,


    My main goal ist actually includes 2 stages:


    1. I want to see the statistical profiling results by using trace data, XDS506PRO Tracer and Code Composer Studio.
    2. Capture the trace data for statistical profiling, without using any tracer or CCS, which I want to integrate the system into my field applications.


    To do so, i included the .lib project and some other changes (osal.h etc.) and added the following functions which can be called during the application runs:
    ctools_dsptrace_init()
    ctools_stat_prof_start()
    ctools_stat_prof_end()
    ctools_dsptrace_shutdown()

    I completed stage 1 thanks to you, and now want to integrate the 2nd stage into my devices, those are distributed to the field.


    As I understand from the CToolsUCLib index.html, I can capture and export the trace data in 3 ways:
    1.DSP ETB drain using CPU
    2.DSP ETB drain using EDMA
    3.External Emulator like XDS560 PRO or XDS560T


    Can I use 1st or 2nd way to achieve the explained application?


    If the answer is no, How can I capture the trace data, without any tracer and store the data to investigate later?


    If yes, how can I do (do I need to customize the other parts of the projects)?

    Thank you,

    Enes

  • Hi Enes,

    Sorry for the delay.  Based on your description I would recommend #2 (DSP ETB drain using EDMA).  

    The processor sdk includes some documentation that addresses your questions.  See : ctoolslib_2_2_0_0/packages/ti/ETBLib/doc/html/edma3_page.html

    Please let me know if there is anything else I can assist you with.

    thanks,

    --Jason

  • Hi Jason,

    Is there any way to implement those type of applications in arm cores by using C commands?

    I investigated the arm core trace data by using ProTracer and CCS> Hardware Trace Analyzer > PC Trace.

    My question is can I collect these data by using C functions, such as:
    ctools_etb_init
    ctools_pct_start_now etc.


    ctoolslib_2_2_0_0/packages/ti/Ctools_UCLib/doc/Ctools_UCLib_html/_p_c__trace.html

    As I understand from the above document, these functions can be used for only DSP projects due to the DSP ETB buffer (PC Trace - ETB drain via EDMA (ETB extension to capture more than 4KB)),

    Is there any way to implement the same application for ARM projects?

    PC Trace is just an example, it would be Statistical Profiling, Function Profiling or Code Coverage...

    Best Regards!

    Enes

  • Hi Enes,

    Your understanding is correct--ctoolslib focuses on DSP and system level (e.g. CPTracers) trace functionality.  

    While you might be able to build on top of eisting ETMLib and ETBLib functionality to accomplish what you are looking for, this is not something that is supported in ctoolslib. 

    thanks,

    --Jason