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

nRF52840 USB example crash

Hi. I've just received my nRF52840-PDK and now I am trying to run usb examples from SDK 13.1.0.

I have started with VisualGDB using arm-eabi toolchain and USB HID Generic example from the SDK. The project built and flashed without errors. But when I connect second USB I get SIGTRAP exception in reent.c on NVIC_Enable_IRQ() in core_cm4.h. Pretty the same as here. The solution in that thread was to change startup files, but don't know how to make it. So this is a question number 1.

I have also tried to flash precompiled .hex files from the SDK, but for every USB example none of my PCs could recognize this USB device. So maybe I need to install some drivers for HID examples?

Other options I have checked, without success:

  • build with GNUARM toolchain from command line as well as from VisualGDB (in case of VisualGDB I had to select software FP instead of hardware, and disable softdevice);
  • build with arm-eabi from VisualGBD using SDK 13.0.0 and 13.1.0.
  • build projects from examples in IAR, not succeeded.

What do I need to do to get working USB on nRF52840?

  • Hi @hungbui,

    I have already used another PC, and I have only one DK to test. Here is sample project from the SDK created for VisualGDB

  • I'm sorry that it's a little bit busy here to test the VidualGDB project. But if you have issue with the precompiled hex I don't think it's about your project setting of start up file. HID device should work out of the box. I would suggest to acquire another nRF52840 PDK for testing and replace your current board. If you want to compile and test an example, I would suggest to also try with gcc. But I don't think it would make any different compare to the pre-compiled hex.

  • Hi @hungbui,

    Yeah, you are right, I have already compiled with gcc and flashed the resulted .hex to the device and got the same situation with not recognized USB device.

  • One more question, just for clarification for flashing process. Do I need to flash specific soft device, make some other configuration changes to the board to run precompiled .hex? And to flash this .hex, I just copy it to the board, which recognized as USB drive.

  • No, the USB example doesn't require softdevice. It's fine to do drag and drop. But we usually suggest to use nRFGo Studio or nrfjprog tool to do flash programming, instead of drag and drop to the USB drive.

1 2 3 4