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 to setup trace analyzer to record a desired tracing point?

Other Parts Discussed in Thread: AM3358, AM3352

Hi,

I use CCS 6.1 on Windows 7 64-bit desktop, for AM3358 Starter Kit board. I want the tracing to record from the main() function, see below picture please. I have tried several settings on 'Receiver' and 'PC Trace' under 'Advanced Property' dialog window. It always record the same tracing data til to the halt of the program. BTW, I have tried to uncheck 'Synchronize trace collection with target run and halt' box. I have tried to set 'Receiver' 'Trace collection' as 'After' under 'Trigger Position'.

Can anybody help me on how to set to trace from a beginning point of a program?

Thanks,

  • If you normally halt at main() after loading the program, and then set up your Trace data collection at that point, it will start tracing from that point onwards.

    Have you had a look at this training module?
    http://processors.wiki.ti.com/index.php/CCS_Modules_Library#Processor_Trace

  • Jeff Wong1 said:
    It always record the same tracing data til to the halt of the program. BTW, I have tried to uncheck 'Synchronize trace collection with target run and halt' box. I have tried to set 'Receiver' 'Trace collection' as 'After' under 'Trigger Position'.

    According to the ARM Embedded Trace Buffer Technical Reference Manual DDI 0242B the Trigger Counter register should in theory allow the tracing to be triggered when an instruction at a particular address is executed (e.g. start of main) and then stop the tracing when the ETB is almost full by setting the Trigger Counter to "Trace After".

    From an investigation using the Cortex-A8 in an AM3352 connected by a Blackhawk USB560-M, with CCS 6.1:

    1) The ETB Receiver "Trace Collection" setting of Before, After or About does change the value in the ETB Trigger Counter Register in line with the ARM ETB TRM.

    2) Regardless of the "Trace Collection" setting, after halting of the program:

    a) The PC Trace Viewer always showed the trace data prior to halting of the program.

    b) The Triggered bit was clear in the ETB Status Register and the ETB Trigger Counter Register was non-zero.

    This means that the ETB had not been triggered to halt while the program was running, and explains why the trace data was that prior to halting the program.

    3) The CCS 6.1 GUI doesn't expose any mechanism to set a ETM trigger, where the ETM trigger is theory can be used to cause the ETB to stop storing data. Therefore, after enabling the PC Trace, a GEL hotmenu function was used to write to the ETM_ADDR_CMP1, ETM_ADDR_ACC1 and ETM_TRIG_EVNT registers to enable the generation of an ETM trigger at the start of a function.

    This had an effect, since after halting the program the Triggered bit in the ETB Status Register was now set. However, the trace data was still that prior to halting the program rather than being referenced to the trigger point.

    4) The conclusion is that the ETB in the AM335x doesn't support the trigger functionality to be able to stop the trace capture when full. The TI ETB FAQ notes that not all types of ETB support a trigger to stop target tracing when a buffer is full.

    To avoid confusion, should the CCS GUI grey-out the ETB Receiver "Trace Collection" setting if the type of ETB doesn't support the use of a trigger?

  • Jeff Wong1 said:
    Can anybody help me on how to set to trace from a beginning point of a program?

    It is possible to configure a "Start Trace" action to cause the trace to start at the beginning of a function. E.g.:

    However, since the ETB in an AM335x only supports circular buffer mode, once the trace has been started the trace needs to be stopped before the ETB becomes full to be able to see trace data from the start point. E.g. by setting a End Trace action:

     

  • I once re-select the settings of the default, then there were ETB records shown in the window. It looks like some default settings are not set, even it shows there. A manual reset, though using its display value, can have the trace record. Because I have no time, and some of its settings, such as trigger (after, before, around) are not sure to me, I don't know whether the record is correct.
    Anyhow, ETB on XDS560v2 on C6678 has no such confusing to me. I have no idea about the low cost XDS100 can give, or because the setting is incorrect.

    Thanks for your investigation.