Keil Logo

Debug Driver Configuration Freescale MKL25Z Devices

To enable CoreSight MTB tracing on Freescale MKL25Z devices:

  • Connect the target board and the host computer through a USB cable.
  • Configure µVision to capture MTB trace data.

Configure µVision to capture MTB trace data.

  1. Create a text file, for example DBG_MTB.ini, and enter the following code:
    /*-------------------------------------------------------------------
    ** Define the function to enable the trace port
    **-----------------------------------------------------------------*/
    FUNC void MTB_Setup (void) {
      unsigned long base;
      unsigned long master;
      unsigned long watermark;
      unsigned long _flow;
    
      master     = 0x80000008;
      _flow      = 0x00000000;
    
      base       = _RDWORD(0xF000000C);     // BASE
      watermark  = base + ((16 << (master & 0x1F)) - 32);
      _flow     |= watermark;
    
      _WDWORD(0xF0000004, 0x00000000);      // MASTER
      _WDWORD(0xF0000000, 0x00000000);      // POSITION
      _WDWORD(0xF0000008, _flow);           // FLOW
      _WDWORD(0xF0000004, master);          // MASTER
    }
    
    /*-------------------------------------------------------------------
    ** Invoke the function at debugger startup
    **-----------------------------------------------------------------*/
    MTB_Setup();
    

    Use the _WDWORD command to configure the device.

  2. Open the dialog Options for Target — Debug and insert DBG_MTB.ini into the field Initialization File.

    Configure the device for tracing

Start the debugging session and verify the captured trace data with a µVision window.

Note

  • Use the examples delivered with the Freescale board FRDM-KL25Z as a reference.
  • MTB tracing works in Serial Wire Debug as well as in JTAG Debug mode.
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.