This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Why does the nRF52840 fail to boot into its application after powering on over a USB interface if that USB interface does not connect to a computer?

Subject pretty much explains the problem.  One can just get power from a USB interface, but if I plug our nRF52840 into such an interface, it does not appear to boot into its application.  I see the main LED blinking rapidly.  When I subsequently plug that board into a USB interface on a computer, it starts the application.

These nRF52840 boards should work and boot into their application regardless of whether the USB interface connects to a computer.  The application may be a mobile app, and if so, it should not have to be connected to a PC.  Instead, it should work off a battery pack with a USB port.

  • Jared: I don't see away to reply directly to your reply, or otherwise continue the discussion.  Nevertheless I don't think I was clear enough, and thus need to respond.

    An application for the nRF52840 will likely have code to trace or log at key points.  If any attempt to access the USB interface as a serial port causes the application to reboot if that USB interface does not lead to a CPU, then the application developer has to come up with a build process/ make target that eliminates all logging, and also all printf's. While feasible, that is a bit of a hassle.

    This is why I keep asking about what causes an application on the nRF52840 to fail and reboot.

    >If you don't use the USB interface for communication then it doesn't make sense to use it for debugging.

    Sorry, I don't agree with this.  See above.

    >I  would instead suggest that you use an external debugger to debug the application running on the DK.

    But does that not require a dongle?  They are not inexpensive and they can have a learning curve. Plus, tracing an application can have advantages over a dongle, since with tracing you may have a better chance of seeing problems when the application is interacting with something external, say over its radio.

    >Note that the nRF52DK has an external debugger, so if you have two you could connect the debugger on the second DK to the first for debugging the application.

    Can you please provide more detail here?

    Thanks.

  • Robert, 

    So let me rephrase myself. If the USB peripheral is used, meaning that the peripheral itself is used not only for powering the nRF but actually used in the application. Then the application might fault if the initialization  process isn't done correctly. My understanding is that you're not just using the USB for powering the nRF but also using it for logging by using it as a serial port. I therefore suspect that the application is failing when you only connect it to a power source, but try to later write to the serial port in your application. Depending on how a error is handled, the nRF will reset and reboot the application when it hits the error handler. If my understanding of your application is not correct then please share more details regarding your application. 

    An application for the nRF52840 will likely have code to trace or log at key points.  If any attempt to access the USB interface as a serial port causes the application to reboot if that USB interface does not lead to a CPU, then the application developer has to come up with a build process/ make target that eliminates all logging, and also all printf's. While feasible, that is a bit of a hassle.

    Why would you write to the serial port if it's not connected to something on the other side? 

    But does that not require a dongle?  They are not inexpensive and they can have a learning curve. Plus, tracing an application can have advantages over a dongle, since with tracing you may have a better chance of seeing problems when the application is interacting with something external, say over its radio.

    What platform are you using? Is it a DK, Dongle or a Custom board? Either way, if you have a DK then you could the J-link onbard to debug your DUT. See here.

Related