[SOLVED] Accessing ETM Trace data from J-Trace

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Hi,


    it is possible to access both STrace and RAWTrace Data. We added a few SEGGER specific command to SEGGER GDB-Sever.
    How to access STrace data is described in UM8001 Chapter 3 "J-Link software and documentation package" Section 3.3 "J-Link GDB Server", subsection 3.3.4 "SEGGER-specific GDB protocol extensions".

    RAWTrace Data can be accessed in a similar way, but is not documented yet.
    Rough documentation:

    RAWTRACE protocol:
    qSeggerRAWTRACE:supported
    Check if RAWTRACE protocol is supported and if connected emulator supports RAWTRACE
    Response: "OK" on success or "" or "Error:<Desc>" on error

    qSeggerRAWTRACE:start
    Usually called right before starting the CPU <TraceFreq> is in decimal, frequence in Hz
    Response: "OK,<TraceFreq>" on success or "" or "Error:<Desc>" on error

    qSeggerRAWTRACE:stop
    Usually called after CPU has been stopped and before reading trace data <NumBytesInTraceBuffer> are In hex
    Response: "OK,<NumBytesInTraceBuffer>" on success or "" or "Error:<Desc>" on error

    qSeggerRAWTRACE:read:<NumBytes>
    Response: Data. Each byte is transmitted as two-digit hex value


    Best regards,
    Niklas
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi Niklas,

    thanks for your reply.

    How big is the trace buffer in the probe?
    How can i achieve a continuous instruction trace ?

    thanks for mentioning to the gdb extension chapter.
    I can't find an available version of UM08002 (J-Link SDK user). where can I download it ?

    best regards
  • Hi,

    How big is the trace buffer in the probe?

    J-Trace for Cortex-M: 16MB
    J-Trace ARM: 2MB

    How can i achieve a continuous instruction trace ?

    The target device needs the be stopped prior to reading the trace buffer of J-Trace.
    Therefore, if you want to fetch all instructions and not *only* the last 16MB, the target device needs to be manually stopped before the buffer is full.
    J-Trace can not automatically stop the target if the buffer is full.

    I can't find an available version of UM08002 (J-Link SDK user). where can I download it ?

    This is part of the J-Link SDK (Part No 8.08.06 on the price list).

    Best regards,
    Niklas
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi,


    Streaming trace (streaming trace data to the PC in real-time while the target application is running) is no supported by the current model of J-Trace Cortex-M.
    A new model for which this is supported, is planned for beginning of next year.
    Other things like code coverage, profiling etc. come later, when the new J-Trace model with streaming trace is available.


    Best regards,
    Niklas
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi,


    Are you referring to the upcoming version of J-Trace that supports Streaming Trace or the current model?

    Best regards,
    Niklas
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • these commands wont work for me:

    RAWTRACE protocol:
    qSeggerRAWTRACE:supported
    Check if RAWTRACE protocol is supported and if connected emulator supports RAWTRACE
    Response: "OK" on success or "" or "Error:" on error

    qSeggerRAWTRACE:start
    Usually called right before starting the CPU is in decimal, frequence in Hz
    Response: "OK," on success or "" or "Error:" on error

    qSeggerRAWTRACE:stop
    Usually called after CPU has been stopped and before reading trace data are In hex
    Response: "OK," on success or "" or "Error:" on error

    qSeggerRAWTRACE:read:
    Response: Data. Each byte is transmitted as two-digit hex value
    SEGGER J-Link GDB Server V5.10k Command Line Version

    JLinkARM.dll V5.10k (DLL compiled Feb 9 2016 18:31:20)

    -----GDB Server start settings-----
    GDBInit file: none
    GDB Server Listening port: 2331
    SWO raw output listening port: 2332
    Terminal I/O port: 2333
    Accept remote connection: localhost only
    Generate logfile: off
    Verify download: on
    Init regs on start: on
    Silent mode: off
    Single run mode: on
    Target connection timeout: 0 ms
    ------J-Link related settings------
    J-Link Host interface: USB
    J-Link script: none
    J-Link settings file: none
    ------Target related settings------
    Target device: STM32F429VG
    Target interface: SWD
    Target interface speed: 1000kHz
    Target endian: little

    Connecting to J-Link...
    J-Link is connected.
    Firmware: J-Trace Cortex-M Rev.3 compiled Sep 4 2015 18:16:12
    Hardware: V3.10
    S/N: 203200685
    Feature(s): RDI, FlashBP, FlashDL, JFlash, GDB
    Checking target voltage...
    Target voltage: 3.29 V
    Listening on TCP/IP port 2331
    Connecting to target...Connected to target
    Waiting for GDB connection...Connected to 127.0.0.1
    Reading all registers
    Read 4 bytes @ address 0x00000000 (Data = 0x2002FFFF)
    Target interface speed set to 1000 kHz
    Resetting target
    Halting target CPU...
    ...Target halted (PC = 0x0800B2C4)
    R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
    R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
    R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
    R12= 00000000, R13= 2002FFFC, MSP= 2002FFFC, PSP= 00000000
    R14(LR) = FFFFFFFF, R15(PC) = 0800B2C4
    XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
    CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
    Reading all registers
    Read 4 bytes @ address 0x0800B2C4 (Data = 0xD034F8DF)
    Select auto target interface speed (2000 kHz)
    Flash breakpoints enabled
    Semi-hosting enabled (Handle on BKPT)
    Semihosting I/O set to TELNET Client
    SWO disabled succesfully.
    SWO enabled succesfully.
    Read 4 bytes @ address 0x0800B2C4 (Data = 0xD034F8DF)
    Downloading 428 bytes @ address 0x08000000 - Verified OK
    Downloading 4096 bytes @ address 0x080001B0 - Verified OK
    Downloading 4096 bytes @ address 0x080011B0 - Verified OK
    Downloading 4096 bytes @ address 0x080021B0 - Verified OK
    Downloading 4096 bytes @ address 0x080031B0 - Verified OK
    Downloading 4096 bytes @ address 0x080041B0 - Verified OK
    Downloading 4096 bytes @ address 0x080051B0 - Verified OK
    Downloading 4096 bytes @ address 0x080061B0 - Verified OK
    Downloading 4096 bytes @ address 0x080071B0 - Verified OK
    Downloading 4096 bytes @ address 0x080081B0 - Verified OK
    Downloading 4096 bytes @ address 0x080091B0 - Verified OK
    Downloading 4096 bytes @ address 0x0800A1B0 - Verified OK
    Downloading 4096 bytes @ address 0x0800B1B0 - Verified OK
    Downloading 4096 bytes @ address 0x0800C1B0 - Verified OK
    Downloading 4096 bytes @ address 0x0800D1B0 - Verified OK
    Downloading 4096 bytes @ address 0x0800E1B0 - Verified OK
    Downloading 4096 bytes @ address 0x0800F1B0 - Verified OK
    Downloading 4096 bytes @ address 0x080101B0 - Verified OK
    Downloading 4096 bytes @ address 0x080111B0 - Verified OK
    Downloading 4096 bytes @ address 0x080121B0 - Verified OK
    Downloading 4096 bytes @ address 0x080131B0 - Verified OK
    Downloading 4096 bytes @ address 0x080141B0 - Verified OK
    Downloading 4096 bytes @ address 0x080151B0 - Verified OK
    Downloading 4096 bytes @ address 0x080161B0 - Verified OK
    Downloading 1608 bytes @ address 0x080171B0 - Verified OK
    Downloading 1420 bytes @ address 0x080177F8 - Verified OK
    Downloading 4 bytes @ address 0x08017D84 - Verified OK
    Downloading 4 bytes @ address 0x08017D88 - Verified OK
    Downloading 2260 bytes @ address 0x08017D8C - Verified OK
    Read 4 bytes @ address 0x0800B2C4 (Data = 0xD034F8DF)
    Read 2 bytes @ address 0x080174CA (Data = 0xF7F0)
    Read 2 bytes @ address 0x080174CA (Data = 0xF7F0)
    Comparing flash [....................] Done.
    Verifying flash [....................] Done.
    Resetting target
    Halting target CPU...
    ...Target halted (PC = 0x0800B2C4)
    Read 2 bytes @ address 0x080174CA (Data = 0xF7F0)
    Read 2 bytes @ address 0x080174CA (Data = 0xF7F0)
    Read 2 bytes @ address 0x080174CA (Data = 0xF7F0)
    R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
    R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
    R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
    R12= 00000000, R13= 2002FFFC, MSP= 2002FFFC, PSP= 00000000
    R14(LR) = FFFFFFFF, R15(PC) = 0800B2C4
    XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
    CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
    Reading all registers
    Read 4 bytes @ address 0x0800B2C4 (Data = 0xD034F8DF)
    Setting breakpoint @ address 0x080174CA, Size = 2, BPHandle = 0x0001
    Starting target CPU...
    ...Breakpoint reached @ address 0x080174CA
    Reading all registers
    Read 4 bytes @ address 0x080174CA (Data = 0xFC8FF7F0)
    Removing breakpoint @ address 0x080174CA, Size = 2
    Read 4 bytes @ address 0x2002FFF8 (Data = 0x0800B2FB)
    Read 4 bytes @ address 0x2002FFF8 (Data = 0x0800B2FB)
    Read 4 bytes @ address 0x0800B2FA (Data = 0xFFFF4770)
    Read 4 bytes @ address 0x2002FFF8 (Data = 0x0800B2FB)
    Read 2 bytes @ address 0x0800B2C4 (Data = 0xF8DF)
    Read 2 bytes @ address 0x0800B2C6 (Data = 0xD034)
    Read 4 bytes @ address 0x0800B2FC (Data = 0x2002FFFF)
    Read 2 bytes @ address 0x0800B2C8 (Data = 0x2100)
    Read 2 bytes @ address 0x0800B2CA (Data = 0xE003)
    Read 4 bytes @ address 0x2002FFF0 (Data = 0x200008D4)
    Read 4 bytes @ address 0x2002FFEC (Data = 0x00000000)
    Read 4 bytes @ address 0x2002FFF0 (Data = 0x200008D4)
    Read 4 bytes @ address 0x2002FFEC (Data = 0x00000000)
    Read 4 bytes @ address 0x2002FFF0 (Data = 0x200008D4)
    Read 4 bytes @ address 0x2002FFEC (Data = 0x00000000)
    Read 4 bytes @ address 0x2002FFF0 (Data = 0x200008D4)
    Read 4 bytes @ address 0x2002FFEC (Data = 0x00000000)
    WARNING: Unsupported remote command "qSeggerRAWTRACE:supported"

    The post was edited 2 times, last by pruesch ().

  • Hi,

    The qSeggerRAWTRACE commands are not to be entered in GDB directly,
    but are extensions of the remote protocol between GDB and GDB Server.

    In general GDB does not know about tracing, so you will have to extend your GDB or write your own application using the GDB remote protocol,
    which can handle the response of GDB Server to these commands.

    Alternatively you could use another IDE which supports tracing directly.

    Best regards
    Johannes
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.