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

BLE NUS central + USB (usb not enabled on power detection)

Hi all,

I'm trying to combine the BLE NUS central with USB CDC functionality.

I have copied over functions from the USB CDC ACM example into the BLE_APP_UART central example. 

I have enabled all the relevant USB modules in sdk_config.h

Upon flashing, the BLE NUS central functions work well. However as soon as I connect the nRF USB, the program hangs immediately.

I discovered that this issue is due to the USB peripheral waiting to be enabled upon receiving the power detection event.

This is the loop below.

while (0 == (NRF_USBD_EVENTCAUSE_READY_MASK & nrf_usbd_eventcause_get()))
{
/* Empty loop */
}

So it seems that EVENTCAUSE is always 0 and the loop never ends.

I'm using SES with SDK15, which already has the errata fixes implemented, so I'm quite unsure why this issue still persists.

However, I found out that I can make my code work by first flashing the usb_cdc_acm example, then flashing my actual modified code.

It works until I reflash it again. Then I would need to repeat the procedure.

I'm testing this using a custom PCB with the rev1 QIAA-C0 variant, as I have a non-working USB V0.92 PCA10056.

Any help appreciated. I can provide the SES project file if needed.

  • Any progress on this? I am having a similar problem which I documented here:

    https://devzone.nordicsemi.com/f/nordic-q-a/37812/usb-not-enumerating-without-jlinkexe-running

    I know my application is running because my custom hardware has an OLED screen which works, and my BLE functionality is working.

    My device does not enumerate over USB unless I have JLinkExe connected with J-Link Pro over SWD. If I simply run JLinkExe and type "connect" to the running application, the USB immediately enumerates. I do not have to physically disconnect the JLink Pro from SWD to see the lack of enumeration (or the subsequent enumeration when using JLinkExe and"connect").

    No amount of connecting/disconnecting a USB cable works with JLinkExe "disconnected" but once JLinkExe is running, I can connect/disconnect a USB cable repeatedly and get enumeration reliably.

Related