Hi, it is actually the code in the function cs_trace_enable() in cs_trace_source.c from CSAL that does this, so I assumed that this was correct. https://github.com/ARM-software/CSAL/blob/790f714544b2329d657619d7cc0f063c3c...
The Coresight documentation says, about the ETMEN bit: This bit must be set by the trace software tools to ensure that trace output is enabled from this ETM so I assume it should be set. Also I noticed, that there is no trace output to the buffer when I remove the line that sets it, so I think it has to be enabled.
For the sake of testing I put the _cs_set(d, CS_ETMCR, CS_ETMCR_ETMEN); before _cs_etm_disable_programming(d);
This results in the access sequence: ** csaccess: enable path from 500DC000 ** csaccess: enable path from 50091000 ** csaccess: enable input port 0 of funnel 50091000 ** csaccess: 50091000: write 000 (off) = 00000301 ** csaccess: funnel inputs now 00000301 ** csaccess: 500DC000: write 000 (off) = 00000C60 ** csaccess: 500DC000: write 000 (off) = 00000860 ** csaccess: 500DC000: bit 010.00000002 clear after 0 iterations control register of etm is 00000860
** csaccess: enable path from 500DD000 ** csaccess: enable path from 50091000 ** csaccess: enable input port 1 of funnel 50091000 ** csaccess: 50091000: write 000 (off) = 00000303 ** csaccess: funnel inputs now 00000303 ** csaccess: 500DD000: write 000 (off) = 00000C60 ** csaccess: 500DD000: write 000 (off) = 00000860 ** csaccess: 500DD000: bit 010.00000002 clear after 0 iterations control register of etm is 00000860
but this did not change the buffer content.
Best regards, Finn