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
  • I just upgraded to SoftDevice 140v6.1 and SDK 15.1 and redid my sdk_config.h and Makefile from scratch using a blend of buttonless_dfu, ble_hrs and usb_cdc configs.

    Sadly, no change in behavior. Works great if JLinkExe is actively "connected", no enumeration if JLinkExe is disconnected. As soon as I re-connect JLinkExe, within a few seconds, USB gets enumerated by my Mac.

Reply
  • I just upgraded to SoftDevice 140v6.1 and SDK 15.1 and redid my sdk_config.h and Makefile from scratch using a blend of buttonless_dfu, ble_hrs and usb_cdc configs.

    Sadly, no change in behavior. Works great if JLinkExe is actively "connected", no enumeration if JLinkExe is disconnected. As soon as I re-connect JLinkExe, within a few seconds, USB gets enumerated by my Mac.

Children
No Data
Related