AnsweredAssumed Answered

ETM not working on stm32f7

Question asked by fakhar.bilal on Feb 24, 2016
Latest reply on Apr 20, 2018 by botha.philip
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.





    trace_m7.png
the *ini file i used is
01./*-------------------------------------------------------------------
02.** Define the function to enable the trace port
03.**-----------------------------------------------------------------*/
04.FUNC void EnableTPIU(void) {
05.   _WDWORD(0xE0042004, 0x000000E0);    // Set 4-pin tracing via DBGMCU_CR
06.//  _WDWORD(0xE0042004, 0x00000020);    // Set 4-pin tracing via DBGMCU_CR
07.     
08.    _WDWORD(0xE000EDFC, 0x01000000);    //
09.    _WDWORD(0xE00400F0, 0x00000000);    //
10.    _WDWORD(0xE0040004, 0x00000008);    //
11.    _WDWORD(0xE0001020, 0x002002CA);    //
12.    _WDWORD(0xE0001024, 0x0000000);    //
13.    _WDWORD(0xE0001028, 0x00000008);    //
14.         
15.    _WDWORD(0xE0041004, 0x00000000);    //
16.    _RDWORD(0xE004100C, 0x00000003);    //
17.    _WDWORD(0xE0041040, 0x00000002);    //
18.    _WDWORD(0xE0041080, 0x00000001);    //
19.    _WDWORD(0xE004108C, 0x000000FF);    //
20.    _WDWORD(0xE0041004, 0x00000001);    //
21.     
22.}
23. 
24./*-------------------------------------------------------------------
25.** Invoke the function at debugger startup
26.**-----------------------------------------------------------------*/
27.EnableTPIU();
28. 
29./*-------------------------------------------------------------------
30.** Execute upon software RESET
31.**-----------------------------------------------------------------*/
32.FUNC void OnResetExec(void)  {
33.  EnableTPIU();
34.}


which was given in reference manual as


40.15.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



keil.png


but the performance window displays 0 calls 0 time 0% cpu usage.

thank you in advance for any help.
Bilal

Outcomes