[SOLVED] tracing with J-Trace

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

  • [SOLVED] tracing with J-Trace

    Hello Segger Team,

    I would like to trace my program.

    For this I’m using Ozone with a j-Trace Debugger (SW Version 610b) and a TWR-K60 Eval Board. While connecting to the Board I get a License Missing Error Message:

    “The connected J-Link does not have a valid license for the use of Ozone – The J-Link Debugger. J-Link PLUS, UTRA+ and PRO models come with a build in license for Ozone – The J-Link Debugger. …”

    Is the License not included in a j-Trace? You write on the Ozone-Product Page: “Ozone can be used with J-Link PLUS, ULTRA+, PRO and J-Trace” So it should work with my J-Trace, right?

    The pure debugging with setting breakpoints, stepping, disassembly, etc. is working fine. Tracing is only working when I don’t touch the Clock-Distribution --> don’t call the SystemInit Function from the CMSIS.
    Is there anything I should do, or not do to have trace with full core clock speed?


    Thanks and regards

    Markus

    The post was edited 1 time, last by Masmiseim ().

  • Hi Markus,

    could you please open J-Link Commander and take a screenshot? Example:


    Could you provide us with the exact label of the MCU?
    There exist some revisions of the K60 which have no setup time for the trace data signal (= TRACE_CLK and TRACE_DATA are changed at the same time).

    Best regards,
    Niklas
    Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
    Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
    Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
    Notification for Embedded Studio: Link
  • Hello,


    Thanks for the fast Reply. The Label of the MCU is:

    PK60N512VMD100
    0M33Z
    CTDZM1047B

    But this is not the final Hardware we want to use. I just wanted to get the trace running and see how it works. The final hardware will be a K66-based, but our
    hardware-development is still not finished. That’s why I’ve started with this board.


    Regards

    Markus
    Images
    • J-Link Commander.png

      13.64 kB, 668×331, viewed 257 times
  • Hi,

    Unfortunately, 0M33Z is buggy hardware revision.
    Tracing will not work reliable with this unit.

    Regarding the Ozone license:
    The unit was produced 2010-08-12. 6 years ago, the "J-Link Pro Software bundle" was not bundled, but an optional purchase (~500€).
    In order to upgrade to a J-Trace with the required license, I recommend to make use of the SEGGER Trade-In Program, which would give you a credit of 498€ towards your next purchase. Therefore, a new J-Trace Cortex-M would be 498€ (instead of 995€), and a new J-Trace Pro Cortex-M would be 893€ (instead of 1390€).


    Best regards,
    Niklas
    Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
    Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
    Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
    Notification for Embedded Studio: Link
  • Hello Niklas,

    the silicon on the K60-Board is really rather old. But, I could organize a TWR-K80 Board and tried the trace. On this board it is not working at all, regardless if the clock is set or not. “Normal” debugging is working.

    PK80
    FN256VDC15
    0N03P
    CTVDCDA

    Also a buggy silicon or Board?


    Regards

    Markus
  • Hi Markus,


    are you referring to this board?


    Best regards,
    Niklas
    Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
    Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
    Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
    Notification for Embedded Studio: Link
  • Hello Niklas,

    I took a closer look to the Registers of the K80 Board. It looks like the debugger initialized the GPIO-pins incorrect.


    It initializes the Pins PTA6 – PTA9 as trace Pins, but on this board PTA12 – PTA16 is used for trace. I didn’t found a way to configure the pins in ozone, so I tried to configure it in my program. Sadly that didn’t work.

    Any Idea how to configure the pins?

    Regards

    Markus
    Images
    • Ozone K80 Port A.png

      6.81 kB, 216×380, viewed 219 times
    • K80Cortex JZAG.png

      54.78 kB, 704×477, viewed 246 times
  • Hi Markus,

    sorry for the delay in response.
    We are temporarily a little low on manpower, but I will try to squeeze it in this week.
    Thanks for the hint regarding the trace pins.

    Best regards,
    Niklas
    Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
    Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
    Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
    Notification for Embedded Studio: Link
  • Hi Markus,

    you are correct, the J-Link Software currently configures PTA06-PTA10, which is not available on all pin-out options of the K80.
    However, activating the pins in the target software or via Ozone worked fine for me.

    Could you please replace the AfterTargetReset function in your Ozone project file with the following code and provide feedback if it works for you?

    C Source Code

    1. /*********************************************************************
    2. *
    3. * AfterTargetReset
    4. *
    5. * Function description
    6. * Event handler routine. Optional.
    7. *
    8. **********************************************************************
    9. */
    10. void AfterTargetReset (void) {
    11. Target.WriteU32(0x40048038, 0xFFFF); // System Clock Gating Control Register 5 (SIM_SCGC5): Enables Clock for PORT A-E, TSI, LPTMR1, and enables software access to the Low Power Timer module.
    12. Target.WriteU32(0x40048004, 0x00001000); // System Options Register 2 (SIM_SOPT2): TRACECLKSEL (Debug trace clock select) : 1 == Core/system clock
    13. Target.WriteU32(0x40049030, 0x00000400); // Select ALT Mode 4 of Pin A12 (Trace_CLKOUT)
    14. Target.WriteU32(0x40049034, 0x00000440); // Select ALT Mode 4 of Pin A13 (Trace_D3) and enable High drive strength
    15. Target.WriteU32(0x40049038, 0x00000440); // Select ALT Mode 4 of Pin A14 (Trace_D2) and enable High drive strength
    16. Target.WriteU32(0x4004903C, 0x00000440); // Select ALT Mode 4 of Pin A15 (Trace_D1) and enable High drive strength
    17. Target.WriteU32(0x40049040, 0x00000440); // Select ALT Mode 4 of Pin A16 (Trace_D0) and enable High drive strength
    18. }
    Display All


    Best regards,
    Niklas
    Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
    Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
    Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
    Notification for Embedded Studio: Link
  • Hello Niklas,


    Thanks for the scripts. With this extension it is working with my board. It is setting the alternative Pin configuration for the trace pins, but still keeps the original
    one:




    I already tried to deactivate the old pins by extending your code:


    Source Code

    1. void AfterTargetReset (void)
    2. {
    3. Target.WriteU32(0x40048038, 0xFFFF); // System Clock Gating Control Register 5 (SIM_SCGC5): Enables Clock for PORT A-E, TSI, LPTMR1, and enables software access to the Low Power Timer module.
    4. Target.WriteU32(0x40048004, 0x00001000); // System Options Register 2 (SIM_SOPT2): TRACECLKSEL (Debug trace clock select) : 1 == Core/system clock
    5. Target.WriteU32(0x40049030, 0x00000400); // Select ALT Mode 4 of Pin A12 (Trace_CLKOUT)
    6. Target.WriteU32(0x40049034, 0x00000440); // Select ALT Mode 4 of Pin A13 (Trace_D3) and enable High drive strength
    7. Target.WriteU32(0x40049038, 0x00000440); // Select ALT Mode 4 of Pin A14 (Trace_D2) and enable High drive strength
    8. Target.WriteU32(0x4004903C, 0x00000440); // Select ALT Mode 4 of Pin A15 (Trace_D1) and enable High drive strength
    9. Target.WriteU32(0x40049040, 0x00000440); // Select ALT Mode 4 of Pin A16 (Trace_D0) and enable High drive strength
    10. Target.WriteU32(0x40049018, 0x00000000); // Select ALT Mode 0 of Pin A6
    11. Target.WriteU32(0x4004901C, 0x00000000); // Select ALT Mode 0 of Pin A7
    12. Target.WriteU32(0x40049020, 0x00000000); // Select ALT Mode 0 of Pin A8
    13. Target.WriteU32(0x40049024, 0x00000000); // Select ALT Mode 0 of Pin A9
    14. Target.WriteU32(0x40049028, 0x00000000); // Select ALT Mode 0 of Pin A10
    15. }
    Display All



    Which is not working, also resetting it in the Register-View of Ozone is not working, as the debugger is activating the original configuration immediately.


    Regards

    Markus