cancel
Showing results for 
Search instead for 
Did you mean: 

ETM not working on stm32f7

bilal
Associate II
Posted on February 24, 2016 at 11:29

hi,

i am using stm32f7 and for debugging ulink pro, i have tried to enable ETM but not succedded. the connector i am using is, where traceD0-D3 are PE3-PE6. 0690X000006052bQAA.png the *ini file i used is


/*-------------------------------------------------------------------

** Define the function to enable the trace port

**-----------------------------------------------------------------*/

FUNC void EnableTPIU(void) {

_WDWORD(0xE0042004, 0x000000E0); // Set 4-pin tracing via DBGMCU_CR

// _WDWORD(0xE0042004, 0x00000020); // Set 4-pin tracing via DBGMCU_CR


_WDWORD(0xE000EDFC, 0x01000000); // 

_WDWORD(0xE00400F0, 0x00000000); //

_WDWORD(0xE0040004, 0x00000008); //

_WDWORD(0xE0001020, 0x002002CA); //

_WDWORD(0xE0001024, 0x0000000); //

_WDWORD(0xE0001028, 0x00000008); //


_WDWORD(0xE0041004, 0x00000000); //

_RDWORD(0xE004100C, 0x00000003); //

_WDWORD(0xE0041040, 0x00000002); //

_WDWORD(0xE0041080, 0x00000001); //

_WDWORD(0xE004108C, 0x000000FF); //

_WDWORD(0xE0041004, 0x00000001); //


}


/*-------------------------------------------------------------------

** Invoke the function at debugger startup

**-----------------------------------------------------------------*/

EnableTPIU();


/*-------------------------------------------------------------------

** Execute upon software RESET

**-----------------------------------------------------------------*/

FUNC void OnResetExec(void) {

EnableTPIU();

}

which was given in reference manual as

4 Configuration example

To output a simple value to the TPIU:

•

Configure trace I/Os: enable TRACE_CLKINEN in the STM32F75xxx and

STM32F74xxx debug configuration register (DBGMCU_CR).

•

Write @ E000EDFC 01000000; SCS: set TRCENA, otherwise trace registers are not

accessible.

•

Write @ E00400F0 00000000; TPIU: select SYNC PORT Mode

•

Write @ E0040004 00000008; TPIU: select TPIU PORT SIZE=4

•

Write @ E0001020 002002CA; WT: PC MATCH Comparator (PC=0x2002CA)

•

Write @ E0001024 00000000; DWT: No mask apply on comparator

•

Write @ E0001028 00000008; DWT: ETM trig on PC on match

ETM:

•

Write @ E0041004 00000000; Disable ETM

•

Read @ E004100C 00000003; ETM should be in Idle state

•

Write @ E0041040 00000002; Instruction trace source ID = 0x2

•

Write @ E0041080 00000001; Resource for ViewInst enabling event is “always

TRUE�?

•

Write @ E004108C 000000FF; Processor comparator selection for Start:

pc_match0 (=>DWT match)

•

Write @ E0041004 00000001; Enable ETM

the debug settings i have also attached 0690X00000605MLQAY.png but the performance window displays 0 calls 0 time 0% cpu usage. thank you in advance for any help. Bilal
1 REPLY 1
philip2399
Associate
Posted on April 20, 2018 at 14:15

Greetings

I recently also struggled with this. With the uLinkPro I found adding a 2.6ns delay to CLK got it working most of the time. I did not use any ini configuration file. It worked without that.

The Segger J-Trace Pro in Ozone worked without any problems whatsoever.

See my

https://community.st.com/0D50X00009XkY7NSAV

on someone with the F4 also having issues with ETM for some information as to why a delay might be necessary. The timing for the ETM is...odd.