[ABANDONED] nRF9161 debugging with Ozone

  • Hi,

    I'm developing software for Nordic nRF9161 and using Ozone for debugging. I use Nordics nRF Connect for VS Code to write the code and launch the debugging from VS code with Debug with Ozone button.

    Previously when using nRF9160 using "Program & Reset Program" and "Attach to Running Program" worked just fine. Now when using nRF9161 the "Program & Reset Program" fails with this error message

    Code
    Failed to verify @ address 0x00FF8108
    Download failed: error during verification phase

    When selecting nRF9160 under "Tools->J-Link Settings" it works just fine (even when using nRF9161 as hardware).

    Main reason why I'm using Ozone for debugging is that we are using secure bootloaders which write to OTP memory area and with Ozone I was able to debug the code without trying to rewrite the OTP area (This was problem when trying to debug using nRF Connect for VS Code and not Ozone).

  • Hi,
    After having started Ozone via the "Debug with Ozone" button, do you save the Ozone project file or do you always discard the Ozone project when closing Ozone? Could you please try to set-up your project via the Ozone new project wizard, save the project file and then use that project file all the time afterwards?
    Best regards-- AlexD

    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: https://www.segger.com/ticket/

    Or you can contact us via e-mail.

  • I tried to create project trough new project wizard. I got an Cortex-M BusFault Exception error.
    Cortex-M BusFault Exception.

    Code
    The target stopped in BusFault exception state.
    
    
    Reason: Unknown at 0x00035012.
    
    
    For more information about analyzing faults on Cortex-M, refer to:
    https://wiki.segger.com/Cortex-M_Fault.


    Console output

    Here is the .jdebug file which Ozone uses when using "Debug with Ozone" button on Visual Studio Code if that helps.

  • Hi msdg,

    could you please check out the following WIKI page? https://wiki.segger.com/Nordic_Semiconductor_nRF91xx

    I understand that after creating a project with the new project wizard your target runs into an exception. This is often the case when the target is not set-up correctly for debugging, so when starting the application to reach main() - or whatever function Ozone was told to be the startup completion point - an operation fails due to wrongly initialized or uninitialized hardware, thus raising an exception. Does your target operate with a boot loader? In that case you may wish to apply the information found in this WIKI article: https://wiki.segger.com/Debug_on_a_Target_with_Bootloader.


    From the project File I can see that you are loading a file "zephyr.elf" but when it comes to downloading, your are downloading a file merged.hex to address 0x0. Ozone retrieves the debug information (e.g. where a symbol resides) from the ELF file, but if the hex file does not match that ELF file or is being loaded to a wrong address, the memory content in the target does not match the debug information in the ELF file, which will likely cause exceptions as well.

    Why is it required to have a hex file downloaded instead of the ELF file content?

    When creating an Ozone project via the new project wizard, do you also consider the hex file?

    Best regards
    -- AlexD

    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: https://www.segger.com/ticket/

    Or you can contact us via e-mail.

  • That .jdebug file is automatically generated by Nordic toolkit for vscode and matches my first posts error message. The error was when I tried to use Ozones new project wizard.

    I am using bootloader. The merged.hex file consists of the bootloader and the application. zephyr.elf is only for application.

    On nRF9160 this .jdebug file works just fine. Only difference is that SetDevice is set to nRF9160 and not nRF9161. But with nRF9161 I get error on verification phase. Is it possible to skip verification on some parts or skip it totally?

  • Hi msdg,

    apparently the Ozone project file created by your tooling is not working correctly. So you should switch to setting up an Ozone project and maintaining that by yourself. You may use the Ozone project created by the new project wizard as a starting point and integrate the special handling found in the Ozone project your tooling provided. This would be a starting point for any further investigation.

    Having done so, could you please provide the Ozone project file as well as an Ozone log and a J-Link log, both logs being recorded during the same debug session where the issue is reproduced? How to create an Ozone log is described in section 8 of the Ozone user's manual, creating a J-Link log is described here: https://wiki.segger.com/J-Link_DLL#Enable_J-Link_Log_File.

    Best regards
    -- AlexD

    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: https://www.segger.com/ticket/

    Or you can contact us via e-mail.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!