[SOLVED] J-Trace to debug using IAR

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

  • [SOLVED] J-Trace to debug using IAR

    I have a project that was built using IAR's Embedded Workbench. The target hardware contains an Nordic Semi nRF52832 from which only GND, Vcc, SWDIO and SWCLK are available on the outside. Flash and debug always worked flawlessly on this hardware using a simple J-Link but that one is no longer available to me. I do have a J-Trace Pro for ARM Cortex-M available though.

    The problem I'm facing is that IAR's debugger won't play nice with J-Trace. It flashes correctly but once the debugger is started it just breaks and a dialog pops up it can't detect the trace clock. I don't want to trace, I just want to debug!

    The configuration does work when using Ozone, but for convenience it would be nice to use the IAR debugger. Is there anything I can do to make this configuration work?

    Second question: we probably need to redesign the target hardware. Will tracing work if I just add TRACEDATA[0..3] and TRACECLK pins or do I need more? The manual is not entirely clear in this respect; for example, it just says SWO is optional but doesn't mention restrictions.
  • Hello,

    Thank you for your inquiry.
    It seems that IAR tries to configure tracing automatically each time a J-Trace debug probe is used...
    This is of course in cases like yours unwanted behaviour. Usually we suggest our IDE partners to implement the trace functionality as a opt-in function to avoid this problems.
    Unfortunately there seems to be no opt-out in this case as well.
    The closest thing i could find was the setting J-Link/J-Trace-> Setup -> ETM/ETB -> check "Prefer ETB"

    This should disable automatic ETM setup and it will try ETB setup instead. The Nordic chip does not have ETB avaialble, but the error message for a failed ETB setup should be less intrusive.
    Does that work as a workaround for you?

    Second question: we probably need to redesign the target hardware. Will tracing work if I just add TRACEDATA[0..3] and TRACECLK pins or do I need more?

    That is all you need for optimal ETM tracing.
    SWO is a different kind of tracing and is not to be paired with ETM pin trace.

    Should you be looking into tracing we offer example projects for many different MCUs. We also have one ready for the nRF52 device family: wiki.segger.com/Tracing_on_Nordic_Semiconductor_nRF52

    As the optimal trace debug software platform we recommend using Ozone as it supports the full feature set of the J-Trace probe including streaming trace and live analysis.

    Best regards,
    Nino
    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.
  • Thanks for your prompt answers Nino!

    Unfortunately, ETB selection results in continuous popups of "Driver" dialogs "Warning: ERROR: Failed to stop trace" at every command I execute (step, reset, everything really). Unfortunately, we have no support contract with IAR (we're just a small startup that can't justify the extra expense there) so basically we're euhm... you know. Is there anything Segger can do to push this issue a bit harder to IAR? I know IAR has its own debug pod but it never hurts to ask eh?

    Anyway, it looks like I'll just have to switch to Ozone for now. Sounds like that is the preferred solution for the future anyway so it may not be a bad idea to get used to it now. Hopefully I won't run into compatibility issues here (being somewhat familiar with some pretty obscure ELF/DWARF interpretations I fear for it...).
  • Hello,

    Unfortunately, ETB selection results in continuous popups of "Driver" dialogs "Warning: ERROR: Failed to stop trace" at every command I execute (step, reset, everything really).


    Hmm unfortunately there seems to be no other setting that could be tried out here.
    We will discuss internally if there is something that we can improve in the behaviour when an IDE is forcing Trace which is not available. But no promises as it works perfectly well with all other IDE vendors.

    Should you be looking into alternative IDEs for your development we recommend using our own IDE Embedded Studio: segger.com/products/development-tools/embedded-studio/

    It comes with perfect J-Link/J-Trace implementation and works with Ozone hand in hand. It also comes with an IAR project importer for easier project transfers: wiki.segger.com/How_to_port_pr…to_SEGGER_Embedded_Studio

    Also it is much more affordable which could be interesting for startups like you.

    Unfortunately, we have no support contract with IAR (we're just a small startup that can't justify the extra expense there) so basically we're euhm... you know. Is there anything Segger can do to push this issue a bit harder to IAR? I know IAR has its own debug pod but it never hurts to ask eh?


    We will definitely step into contact with them but they have been not to keen into improving J-Link/J-Trace implementation for a while now. But we will try ;)


    Anyway, it looks like I'll just have to switch to Ozone for now. Sounds like that is the preferred solution for the future anyway so it may not be a bad idea to get used to it now. Hopefully I won't run into compatibility issues here (being somewhat familiar with some pretty obscure ELF/DWARF interpretations I fear for it...).


    So far Ozone had never problems interpreting elf files from IAR so you should be good to go.
    Should you run into any issues feel free to contact us again.

    Best regards,
    Nino
    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.