Skip to main content
Rajesh Tripathi
Associate III
February 17, 2019
Question

Trace.ini file for STM32H753 tracing with Keil IDE and ULINK Pro

  • February 17, 2019
  • 2 replies
  • 1996 views

Where to find trace.ini file or it's content for STM32H743/53 tracing with Keil uVision and ULINKPro ?

    This topic has been closed for replies.

    2 replies

    Tesla DeLorean
    Guru
    February 17, 2019

    Probably something you want to query Keil for. The H7 has a SWO Trace Funnel, it doesn't use the TRACEDATA/TRACECLK pins.

    The script would need to walk through enabling clocks, like those in DBGMCU_CR and DBGMCU_APBxyz

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Tesla DeLorean
    Guru
    February 17, 2019

    I'm thinking something like this, working blind...

    FUNC void SetupTrace (void) {
     
     _WDWORD(0x5C001004,(_RDWORD(0x5C001004) | 0x00700000)); // DBGMCU_CR D3DBGCKEN, D1DBGCKEN, TRACECLKEN
     
     _WDWORD(0x5C004FB0, 0xC5ACCE55); // Unlock Funnel
     _WDWORD(0x5C003FB0, 0xC5ACCE55);
     
     //SWO current output divisor register
     //This divisor value (0x000000C7) corresponds to 400 MHz, with 2 MHz SWO Clock
     //To change it, you can use the following rule
     // value = (CPU Freq/sw speed)-1
     //_WDWORD(0x5C003010, 0xC7);
     
     //SWO selected pin protocol register
     _WDWORD(0x5C0030F0, 0x00000002);
     
     //Enable ITM input of SWO trace funnel
     _WDWORD(0x5C004000, (_RDWORD(0x5C004000) | 0x00000001));
     
     // ENABLE SWO PB3
     
     //RCC_AHB4ENR enable GPIOB clock
     _WDWORD(0x580244E0, (_RDWORD(0x580244E0) | 0x00000002));
     
     // Configure GPIOB pin 3 as AF
     _WDWORD(0x58020400, ((_RDWORD(0x58020400) & 0xffffff3f) | 0x00000080));
     
     // Configure GPIOB pin 3 Speed
     _WDWORD(0x58020408, (_RDWORD(0x58020408) | 0x00000080));
     
     // Force AF0 for GPIOB pin 3
     _WRDWORD(0x58020420, (_RDWORD(0x58020420) & 0xFFFF0FFF));
    }
     
    // Executed after reset via uVision's 'Reset'-button
    FUNC void OnResetExec (void) {
     SetupTrace();
    }
     
    SetupTrace();

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Rajesh Tripathi
    Associate III
    February 18, 2019

    Thanks Clive for prompt reply. I'll contact Keil. I actually want to use ETM for performance monitoring with 4 bit use for trace data. I've found example trace.ini file for STM32F4

    http://www.keil.com/support/man/docs/ulinkpro/ulinkpro_STM32F4xx_ETM.htm

    Not sure if the same file can work or needs some additional settings.

    Thanks

    Tesla DeLorean
    Guru
    February 18, 2019

    The Data Sheet talks about PE2..PE6, but the Reference Manual says it doesn't route "no synchronous trace output, that is, no TRACEDATA or TRACECLK pins"

    The F4 initialization brings up GPIOE and the pins, you'd have to replicate that on the H7 for a starts. The registers will be at different locations.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..