Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

RTT logging over JTAG (PCA10056) stops when usbd is enabled

I want to get logs via RTT (JTAG) in the connectivity firmware example of SDKV15.

I have built the connectivity firmware project using cmake and opened the project in SES. The only code changes I made are enabling logging via RTT backend in sdk config file and adding some log outputs in main.c.

I get RTT logs in SES until this code section

#if defined(APP_USBD_ENABLED) && APP_USBD_ENABLED
    usbd_enable();
#endif

After that line, I do no longer get RTT output via JLINK. As I said, besides of enabling logging, there were no changes to the example from SDK.

I found various posts about RTT over JLINK logging interfering with the USB peripheral, but I am not sure about the problem in my case.

//EDIT: I see that it is as simple as not only the logger is stuck, but the program execution simply blocks until an usb event is occuring. A pluggin on/off is one example of that.

Can someone explain, where this behaviour is documented in more detail? It seems that powering on the devkit does not alwasy bevae the same way. E.g. is the USB port on the CDC ACM port of the pca10056 is already attached, the code sometimes is stuck at the mentioned location (no usb event detected?). I can check the cable, also, though.

Thanks!

Parents
  • Hi Franz,

    I would suggest to try other example that uses USB driver, inside \examples\peripheral

    I assume you are testing the ble_connectivity example. In that particular implementation the usbd_enable() will wait in a loop until the USB power event occurs. It's because current softdevice doesn't handle USB power events. 
    This explains why you don't see the log after you call that function, without USB being connected. 

Reply
  • Hi Franz,

    I would suggest to try other example that uses USB driver, inside \examples\peripheral

    I assume you are testing the ble_connectivity example. In that particular implementation the usbd_enable() will wait in a loop until the USB power event occurs. It's because current softdevice doesn't handle USB power events. 
    This explains why you don't see the log after you call that function, without USB being connected. 

Children
No Data
Related