[SOLVED] Ozone: v2.56 regression with Nordic SoftDevice (S140, nRF52840)

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

  • [SOLVED] Ozone: v2.56 regression with Nordic SoftDevice (S140, nRF52840)

    Using Ozone with a Nordic Semi nRF52840-PDK development board, after updating Ozone from v2.54.2 to v2.56 I am no longer able to debug any Bluetooth examples (S140 SoftDevice).

    An unexpected "CPU halt" occurs during the call to sd_softdevice_enable(), in the "ble_app_blinky" example supplied as part of SDK 14.2.0:
    * on either Windows or Linux (Lubuntu)
    * with either the J-Link built into on the nRF5284-PDK board, or when using a J-Link Plus as an external debugger.

    The debugging session proceeds normally when using Ozone v2.54.2, or when using SEGGER Embedded Studio for ARM v3.34. I can single-step or run through the function call without issue.

    The problem persists even if I manually update the J-Link DLL used by Ozone (to v6.30.2).

    Ozone has been great! I hope this issue is an easy fix.
    Images
    • ozone_screenshot.png

      72.34 kB, 1,092×665, viewed 1,155 times
  • Hello,

    Thank you for your inquiry.
    Such an issue is not known to us, but if it is a bug we will of course fix it.
    For easier reproduction could you provide the elf file of your project so we can test it in house with your compiler output?

    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.
  • Hello,

    Thank you for providing a reproduction scenario.
    The issue was reproducible and could be fixed. A fixed release version is expected to be available later today.

    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.
  • Hello,

    Sorry for the delay, we had to run some additional tests. The result is that this was intended design change. So for special cases like yours with a softdevice running you need to set the PC and SP manually in the .jdebug file.
    To do this first close Ozone, then open the .jdebug file for editing in a text editor.
    Find the function AfterTargetDownload() and uncomment it.
    Fill it with:

    C Source Code

    1. unsigned int SP;
    2. unsigned int PC;
    3. SP = 0x00000000;
    4. PC = 0x00000004;
    5. Target.SetReg("SP", SP);
    6. Target.SetReg("PC", PC);


    This is assuming your softdevice loads to address 0x0. Otherwise adjust it accordingly.

    Does that solve the issue?

    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.
  • Hi Nino,

    Thanks again; unfortunately I am still having trouble with v2.56b.

    As I understand it, the Nordic SoftDevice is loaded below the application (link ).

    If I modify the .jdebug file as described (with SP=0x00000000 and PC=0x00000004), either the CPU halts immediately after "download & reset" at PC=0x000008C8 (no matching source), or if I "reset and run to symbol" and step from beginning of main(), the CPU halts as before at sd_softdevice_enable().

    C Source Code

    1. void AfterTargetDownload (void) {
    2. unsigned int SP;
    3. unsigned int PC;
    4. SP = 0x00000000;
    5. PC = 0x00000004;
    6. Target.SetReg("SP", SP);
    7. Target.SetReg("PC", PC);
    8. }
  • Hi,

    Sorry my code snipped was incorrect. We need the value from 0 and 4 not the address itself.

    Correct would be:

    C Source Code

    1. unsigned int SP;
    2. unsigned int PC;
    3. SP = Target.ReadU32(0);
    4. Target.SetReg("SP", SP);
    5. PC = Target.ReadU32(4);
    6. Target.SetReg("PC", PC);


    Does it work that way?

    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.
  • Hi Nino,

    Solved! -- thanks again for your help.

    Please note the problem seemed to recur after target reset, so I have copied the same code into AfterTargetReset(); can now reset target and run again successfully through the call to sd_softdevice_enable(). Bluetooth (i.e. SoftDevice) works normally.
  • Hi,

    Great to hear that you are up and running again.
    Correct AfterTargetDownload and AfterTargetReset need to be edited this way.
    Sorry I thought I wrote that earlier but seems like I missed that.

    We will consider this case as 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.