Need to increase the duration of trace data using CCS-percepio Using Snapshotmode

Hi,

I’m using AM6442, R5 core as a main processor to communicate with percepio-CCS.

#define TRC_CFG_STREAM_PORT_BUFFER_SIZE 1024 * 29

when I’m trying to save the snapshot trace in CCS tool.

I’m able to save the buffer record of 29kb max. If i’m trying to increase the buff recorder size > 30Kb. I’m getting error pop up like “Unable to read memory“.

During 29kb → I’m able to save the trace data (2.3sec) in file which is of 32Kb.

I tried both methods like chunks wise and transfer all too.

Is there any limit of memory in snapshot mode?

How percepio knows that, where to read the record(memory location) and provides to tracealyzer
Is there any configuration? Any doc that may help to understand better..

I’m using XDS200 JTAG Emulator for debugging.
Record to save: i’m using DDR..

Here is my attached configuration screenshot..

I’m not aware of any size limitation in the Eclipse plugin. Do you get the same problem if using the gdb dump command? See Tracealyzer Snapshots with GDB or Eclipse - Percepio

Thanks for the suggestion.

I’m using CCS IDE.

I didn’t tried that, becaz i don’t know how to do in ccs

I checked in memory browser w.r.to recorderdataptr address. It is in valid address ( with in ddr only)..

R u referring to that dump details?

My intrest on, I have more than enough memory in ddr

Eventhough y I’m not able to create trace data for more than 29kb

OK. It seems as CCS doesn’t use GDB, but you could try the following as an experiment to isolate the problem:

Halt the target when the TraceRecorder snapshot is ready.

  1. Open View → Expressions and add RecorderDataPtr (and your size symbol, e.g. RecorderDataSize or whatever you use).
  2. Note the pointer value (e.g. 0x2001_0000) and the buffer size in bytes.
  3. Open View → Memory Browser.
  4. In the address box, enter the address (you can type the symbol name RecorderDataPtr directly, or paste the numeric address).
  5. Right-click inside the Memory Browser and choose Save Memory… (sometimes shown as Export Memory…).
  6. Enter:
    • Start address: the value of RecorderDataPtr

    • Length (bytes): your buffer size (can be larger than necessary if you are uncertain of the exact size)

    • Format: Binary

    • File: trace.bin

Check if this approach allows for larger snapshots. If you get the same issue, it is probably a limitation in the CCS debugging backend.

Yeah. I did that. please find the below ss..

But it is a valid address of my DDR memory.
DDR memory size approx. 16MB

Here is the memory map address of DDR1:

DDR_0 a0100000 00001000 00001000 00000000 RWIX
DDR_1 a0101000 00fff000 000268b0 00fd8750 RWIX

SEGMENT ALLOCATION MAP

run origin load origin length init length attrs members


00000000 00000000 00001148 00001148 r-x
00000000 00000000 00000040 00000040 r-x .vectors
00000040 00000040 00000ac0 00000ac0 r-x .text.hwi
00000b00 00000b00 00000430 00000430 r-x .text.cache
00000f30 00000f30 00000218 00000218 r-x .text.mpu
00001150 00001150 000001b8 000001b8 r-x
00001150 00001150 000001b0 000001b0 r-x .text.boot
00001300 00001300 00000008 00000008 r-x .text:abort
a0100000 a0100000 00001000 00001000 r–
a0100000 a0100000 00001000 00001000 r-- .resource_table
a0101000 a0101000 00018c00 00000000 rw-
a0101000 a0101000 0000cc00 00000000 rw- .bss
a010dc00 a010dc00 00008000 00000000 rw- .sysmem

Sorry to say that, i’m not able add the memory dump file here..
becaz, i’m a new user..

RecorderDataPtr is using the .bss with aprox..32.7KB

So you tried saving the memory dump from the Memory BrowserSave Memory? If you set the format to Binary and name the file something.bin, it should be possible to open directly in Tracealyzer/View (using File → Open → Open FIle) assuming all is well.

(Note that you don’t need to dump the whole memory, just the part where the trace buffer is. Also, the dump doesn’t have to match the exact boundaries of the trace buffer, as long as all data is included.)

Does this work for you?

If so, can you save memory dumps larger than 32 KB in this way, or do you get errors from the CCS SaveMemory function?

yeah I tried that, I’m not able to open that dump.bin file using tracealyzer. It is throwing error shown in the below ss.

but my tracealyzer is licensed.. one

do you get errors from the CCS SaveMemory function?

no..

it is asking from which address, i gave the ptr address and then it is also asking for the bouandary (mandatory) like in terms of words. i gave 65535.. and save the memory dump in dump.bin file.

The error message means that Tracealyzer can’t find anythings that looks like TraceRecorder data in the dump. Did you call xTraceEnable before dumping the data?

yes…

TimerP_start(gTimerBaseAddr[CONFIG_TIMER0]);

/* Enable Tracealyzer */
if (xTraceEnable(TRC_START) != TRC_SUCCESS)
{
    DebugP_log("Trace enable failed.\r\n");
    const char *err = NULL;
    xTraceErrorGetLast(&err);
    while (1)
        ; // Stay here for debugging
}
xTraceStringRegister("Logging", &xUserEventChannel);
xTracePrintF(xUserEventChannel, "Starting Demo...");
reset_timer0_counter_to_zero();

/* Print CPU Clock Frequency */


after success return only i took trace

Now, it’s opened.. Thanq @johankraft

From this, i can save my trace buffer(upto 12MB) w.r.to RAM size availability…
But, we can’t save and open the trace record via Percepio.
Instead of that, I can save via memory dump and try to open via tracealyzer.. right?
that is what is happening in my case..

Due to this memory dump method, i can able to save the minutes of trace data and analyze the CPU…

If it so, as my assumption. From CCS is not able to save trace data via plugin (Percepio→ save snapshot) which is more than 32KB trace bin file..

As my Understanding is correct?

You should be able to upload now.

Where did you get this plugin from? If it is from TI, then you should ask TI.

I don’t quite follow. Do you mean it doesn’t work to use the Percepio Trace Exporter (Percepio menu) if more than 32KB, but it works using the CCS memory dump?

I tested the Ecplise plugin with a 50 KB trace buffer and that worked fine in my setup. This was with STM32CubeIDE though. So there is no limitation in the plugin. However, we have only tested this on Eclipse IDEs based on GDB for the debugging. TI appears to use a different debug server. But great that you got it working anyway. If you want a simpler solution, I think CCS has a scripting system called DDS that might allow for automating the memory dump. I have not tried it, but maybe you could make a dds script for this.

Sorry. I got this from percepio

It’s my assumption.

Yes. It’s working

If I’m doing memory dump method manually

Try to open that in tracealyzer

I’m able to see trace data

But I didn’t tried yet with ccs IDE with the option of gdb.

May be my debug server was different. I will try GDB server.

Tomorrow I will check and let u know..

Thankyou @johankraft for guiding me in a right path till now.