Hang with nRF5 SDK 17.1.0 Bootloader and nRF Connect SDK 2.1.0 application

I have an existing product that is using the nRF5 SDK 17.1.0 Bootloader.  I have updated the application to use nRF Connect SDK 2.1.0.  The new application also has an implementation of the buttonless DFU service, so that the nRF Connect app on iOS can be used to do the updates.

Most of this is working.  The application runs fine when built to run without a boot loader.  When build to run with the boot loader (CONFIG_FLASH_LOAD_OFFSET=0x27000) there is an issue that I'm having trouble debugging.  This is what is happening:

  1. I erase the device and program in the nRF5 SDK 17.1.0 Bootloader.  After reset the boot loader starts up normally.
  2. I use the nRF Connect app on iOS to transfer over the nRF Connect SDK 2.1.0 application.  I get a success message from the nRF Connect app.
  3. The application does not start BLE advertising and the device appears to be hung.
  4. If I attach the VScode debugger, it usually halts inside the boot loader startup sequence where it is checking the CRC.
  5. Looking at the RESETREAS register I see the expected SREQ, but I also see LOCKUP.
  6. If I continue code execution then the application starts up and works fine.

The hang happens every time I run the above sequence.  It happens with or without a debug probe attached.  None of the nrfjprog resets (--reset, --debugreset, --pinreset) have any effect - the device remains hung.  If I attach the debugger before step 2 above then the halt doesn't happen.  The application starts up fine without any hang.

Anyone have any ideas on what might be happening?  Any tips on how to debug this type of issue where simply having the debugger attached avoids the issue?

Parents
  • I change some other config options and have RTT logging enabled.  I added a print to the top of my main.  When I start the app from the debugger (no boot loader) I see a boot message from zephyr and the message from my main:

    *** Booting Zephyr OS build v3.1.99-ncs1 ***

    starting vulcan

    However, if I have RTT logging connected then the code works fine (no hang or reset loop).  Same as when debugger is attached.

    So I created a logging backend that just store the log text in RAM.  Ran from debugger and the log messages are showing up in RAM.

    Now, when I run the boot loader and then DFU my app and have hit the point where things look locked up or in a reset loop and then attach the debugger, I don't see any logging messages.  So seems the issue happens before zephyr prints the boot message.

Reply
  • I change some other config options and have RTT logging enabled.  I added a print to the top of my main.  When I start the app from the debugger (no boot loader) I see a boot message from zephyr and the message from my main:

    *** Booting Zephyr OS build v3.1.99-ncs1 ***

    starting vulcan

    However, if I have RTT logging connected then the code works fine (no hang or reset loop).  Same as when debugger is attached.

    So I created a logging backend that just store the log text in RAM.  Ran from debugger and the log messages are showing up in RAM.

    Now, when I run the boot loader and then DFU my app and have hit the point where things look locked up or in a reset loop and then attach the debugger, I don't see any logging messages.  So seems the issue happens before zephyr prints the boot message.

Children
No Data
Related