Coresight STM and ETF not working on Orin AGX

Hello there,

I’m trying to enable coresight STM driver and bind it to the heartbeat trace source to do some test on Orin AGX.

My steps are:

  1. Enable kernel configs:
    CONFIG_CORESIGHT=y
    CONFIG_CORESIGHT_LINKS_AND_SINKS=y
    CONFIG_CORESIGHT_LINK_AND_SINK_TMC=y
    CONFIG_CORESIGHT_STM=y
    CONFIG_CORESIGHT_SOURCE_ETM4X=y

  2. I can see all the coresight device listed in /sys/bus/coresight
    etm0 etm2 etm5 etm8 funnel1 funnel4 tmc_etf0
    etm10 etm3 etm6 etm9 funnel2 replicator0
    etm11 etm4 etm7 funnel0 funnel3 stm0

  3. ETR device init failed, and I found it is not supported on Orin.
    [ 6.689653] coresight-tmc: probe of 24070000.etr failed with error -13
    error -13 means non-secure debug is disabled by hardware

  4. I enabled STM, ETF device successfully
    echo 1 > /sys/bus/coresight/devices/tmc_etf0/enable_sink
    echo 1 > /sys/bus/coresight/devices/stm0/enable_source

  5. Create stm policy
    sudo mkdir /config
    sudo mount -t configfs none /config
    mkdir /config/stp-policy/stm0.policy
    mkdir /config/stp-policy/stm0.policy/default

  6. Link STM to heartbeat trace source
    echo stm0 > /sys/class/stm_source/heartbeat.0/stm_source_link
    (Successed)

  7. The ETF buffer is empty.
    cat /sys/bus/coresight/devices/tmc_etf0/mgmt/sts
    0x10 → empty ( css600_tmc_etf Status Register, STS)

  8. Dump /dev/tmc_etf0 gives nothing
    dd if=/dev/tmc_etf0 of=dump.bin
    0+1 records in
    0+1 records out
    64 bytes copied, 0.000674339 s, 94.9 kB/s

I tried to use dummy_stm.0 with same steps, it works good.

My question is: Is STM supported on Orin? Can I dump STM trace from etf device? Or are there any mistakes during the steps?

Thank you.
Cyrus Huang

Hi archman,

Are you using the devkit or custom board for AGX Orin?
What’s your Jetpack version in use?

We haven’t verified for this use case.
Is ETF a device connected on the AGX Orin? If so, what’s the interface in use?
May I know what’s your use case for this?

Hi Kevin,

I’m using the official devkit, Jetpack 5.1.2.

My case is very similar to this post:

TMC-ETF is a coresight component as a trace sink in Orin’s chipset.

Normally, with STM or ETM enabled (as trace source), one should be able to dump the CPU or software trace from TMC-ETF or TMC-ETR (as trace sink).

For this issue, the ETR is disabled by hardware and ETF buffer is always empty.

BR
Cyrus

It seems ETR sink is not accessible.

May I know what do you mean about dummy_stm.0?

Dummy STM dummy is a linux virtual STM device based on STM driver framwork. It just implements an STM device interface and provide STM device fs nodes to the application. The core implementation of this device is just a call to trace_printk whitch will print the application trace to the ftrace buffer.

With real STM device, when link to a trace source (like heartbeat or console trace source), the trace will send to coresight hardware and can be dumped from the ETR / ETF fs nodes.

With dummy STM device, it bypass all the coresight stuff, and just route the trace from trace source to the ftrace buffer, and you can get the trace from ftrace interface.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.