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

USB not enumerating without JLinkExe running

Hi,

I am having a problems with USB enumerating with a custom board based on the nRF52840. The board is self powered by LiPo battery. I am developing by connecting to the board with a J-Link Pro over SWD. I am using the armgcc toolchain. My application is SDK 15 based and implements a BLE peripheral and I'm trying to support a USB virtual com port. My applications BLE functionality is working great. I am able to see NRF_LOG_INFO print outs.

Using USBD CDC, I am able to connect my device over USB to my Macbook Pro and send/receive bytes to my application over USB using app_usbd_cdc_acm_write() and receiving in my cdc_acm_user_ev_handler().

I am able to plug and un-plug the USB cable and I see the /dev/tty.usbmodem**** appear and disappear and I receive related events in my cdc_acm_user_ev_handler().  After disconnect/reconnect, I am continue to be able to send/receive bytes to my application over USB.

The problem comes when I quit JLinkExe (regardless of leaving the J-Link Pro connected to the target):

When I quit JLinkExe, my Mac and the target continue to be able to communicate over USB, however if I disconnect the USB cable, and reconnect, I can not get the device to re-enumerate no matter how many times I unplug and re-plug the cable.

If I relaunch JLinkExe, and type "connect", I immediately see my custom board enumerating on the Mac.

I read the following threads:

https://devzone.nordicsemi.com/f/nordic-q-a/37217/ble-nus-central-usb-usb-not-enabled-on-power-detection

https://devzone.nordicsemi.com/f/nordic-q-a/37477/unable-to-run-uart-ble-app-example-without-debugger

And I updated the erreta to 0x20, but my application does not link retarget.c so I don't understand the __putchar signature change. I tried making that change and adding retarget.c, but it does not get used by the linker (and results in no change). I disabled logging with NRF_LOG_ENABLED, and I no longer see any printouts via JLinkRTTClient, but I still have the same failure to enumerate if JLinkExe is not connected.

Any ideas?

Thanks!

Jeremy

Parents
  • So I hooked up my Packet-Master USB500AG and grabbed the traffic between the Mac and the device. Here's what the capture for a failed enumeration looks like. Firstly, I have filtered out all the NAK packets, to make it easier to see the big picture.

    Below you can see the "Get Device Descriptor" never completes. The setup is ACK'd by the nRF52840, but then all attempts by the host to continue with the control transfer fail with NAK:

    Now zooming in on the "Get Device Descriptor" transaction with NAKs (which repeat on in the thousands, interrupted with some SOFs):

    For completeness, this is what it's like when the JLinkExe is connected. Here we can see successful enumeration. I can plug/unplug and re-trigger this enumeration as long as JLinkExe is running. If I quit the JLinkExe software (leaving the J-Link Pro connected to SWD), enumeration will fail...until I re-run and type "connect" in JLinkExe in which case, enumeration will succeed:

Reply
  • So I hooked up my Packet-Master USB500AG and grabbed the traffic between the Mac and the device. Here's what the capture for a failed enumeration looks like. Firstly, I have filtered out all the NAK packets, to make it easier to see the big picture.

    Below you can see the "Get Device Descriptor" never completes. The setup is ACK'd by the nRF52840, but then all attempts by the host to continue with the control transfer fail with NAK:

    Now zooming in on the "Get Device Descriptor" transaction with NAKs (which repeat on in the thousands, interrupted with some SOFs):

    For completeness, this is what it's like when the JLinkExe is connected. Here we can see successful enumeration. I can plug/unplug and re-trigger this enumeration as long as JLinkExe is running. If I quit the JLinkExe software (leaving the J-Link Pro connected to SWD), enumeration will fail...until I re-run and type "connect" in JLinkExe in which case, enumeration will succeed:

Children
No Data
Related