This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

USB CDC doesn't appear as COM in Release. It's visible only in Debug mode.

Hi,
I wanted to merge two example projects: "ble_central/ble_app_uart_c" so I have central client application, and a "peripheral/ble_usbd_ble_uart" so I have working USB CDC. I need such a combination so I could port it to Dongle with PCA10059 that's gonna be Receiver in my communications system (but first I'm gonna test it on DK that has debugger).

The problem is: when I "Build and Run", USB doesn't appear as a COM in my Windows. Restart button doesn't help. It appears only when I "Build and Debug" and let the program work without step-by-step debugging procedure - "Continue Execution" button in debug perspective of SES. The "peripheral/ble_usbd_ble_uart" example works pretty fine.

I'm under impression it might be some power management problem, but I'm too rookie to figure out. I compared the "sdk_config.h" and "main.c" files and I'm under impression it might work, but it doesn't, so I'm wrong somehow. Maybe that's the lack of some .h or .c files.

In Debug mode, the application catches Hard Fault, I think, because whenever I Pause the Continues Execution, it's stuck there:


And the RealTerm freezes once I open VCOM for USB CDC.

In normal Run, it doesn't catch it, I think, becasue I uncommented one of printf() that send received data via regular J-Link UART, and it works pretty fine, but USB VCOM is not visible.

Parents
  • You need to force an USB reset or disconnect event on device (re-)start.

    Simplest solution is to put the USBPULLUP register into "pullup is disconnected" state and then wait about a second.The pulldown resistor in the USB hub pulls the datalines low, forcing a disconnect on the host.

    After that, resume normal operation like app_usbd_init().

Reply
  • You need to force an USB reset or disconnect event on device (re-)start.

    Simplest solution is to put the USBPULLUP register into "pullup is disconnected" state and then wait about a second.The pulldown resistor in the USB hub pulls the datalines low, forcing a disconnect on the host.

    After that, resume normal operation like app_usbd_init().

Children
No Data
Related