[SOLVED] nRF52832 Tracing & Soft resets

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

  • [SOLVED] nRF52832 Tracing & Soft resets

    I'm collecting trace data using J-Trace and Ozone. It is meant for Code Coverage purposes and our test procedures involve several Soft Resets. After a Soft Reset the orange TRACE LED on J-Trace is active, however Ozone stops receiving trace data. Is there a ways for Ozone to keep collecting data after a Soft Reset ?
  • Hello,

    Thank you for your inquiry.
    Arm tracing was not designed to survive resets. So the answer is no.
    What you could try is to halt the debug session after reset and resume it in Ozone. That might work. But any data before that point would be gone.

    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.
  • Adding a breakpoint at the beginning of main() does the job. After a reset execution stops at the breakpoint and, after resuming execution trace data is being collected.

    Is there a way to script this operation? Detect a halt on a breakpoint and call Debug.Continue() automatically ?
  • Hello,

    Great to hear that you are up and running again.
    Yes you can automate Ozones GUI actions.
    Here is an example where an action is executed after e.g. a breakpoint is hit:
    wiki.segger.com/Automated_Tests_with_Ozone#Debug_example

    So you could set a breakpoint before or after main (on main will maybe not work as the debugger clears the breakpoint of the application entry point automatically so you save one hardware breakpoint) and execute the debug contione action which would trigger the whole trace init 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.
  • Thanks for the link. I got the example running just fine, however on my nRF52832 project the callback does not seem to be working.
    See my jdebug file below

    void OnProjectLoad (void) {

    Project.SetDevice ("nRF52832_xxAA");
    Project.SetHostIF ("USB", "");
    Project.SetTargetIF ("SWD");
    Project.SetTIFSpeed ("4 MHz");
    Project.SetTraceSource ("Trace Pins");
    Project.SetTracePortWidth (4);
    Project.AddSvdFile ("Cortex-M4.svd");
    Edit.SysVar (VAR_TRACE_MAX_INST_CNT, 2000000000);
    Edit.SysVar (VAR_TRACE_TIMESTAMPS_ENABLED, 0);
    Edit.SysVar (VAR_TRACE_CORE_CLOCK, 64000000);
    File.Open ("C:/Dev/projects/development/IDE/armgcc/Output/DEBUG/Exe/OUT.elf");

    Util.Log("---Automation started.---");
    Debug.SetResetMode(RM_RESET_AND_RUN);

    Break.SetOnSrc("main.c:156");
    Break.SetCommand("main.c:156","OnBPHit");
    Debug.Start();
    }


    void OnBPHit(void) {
    Util.Log("---BP hit!---");
    Util.Sleep(1000);
    Debug.Stop();
    File.Exit();
    }

    void AfterTargetReset (void) {
    _SetupTarget();
    }

    void AfterTargetDownload (void) {
    _SetupTarget();
    }


    void _SetupTarget(void) {
    unsigned int SP;
    unsigned int PC;
    SP = Target.ReadU32(<SPLocation>);
    Target.SetReg("SP", SP);
    PC = Target.ReadU32(<PCLocation>);
    Target.SetReg("PC", PC);
    }
  • Hello,

    Unfortunately this question is leaving the support scope we can provide via the forum.
    Could you open a support ticket for this instead?
    How is explained in my signature.
    Also make sure that your J-Trace Pro is registered before opening the ticket to speed up the process:
    wiki.segger.com/J-Link_Registration

    This thread will be closed now.

    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.