Hi,
two days ago I started checking the usbd_cdc_acm example in order to add usb serial comm functionality to my project. and I have some fundamental (newbie) questions.
1. Why nrf_drv_clock_lfclk_request(NULL) is being used outside the usbd library? And how does the program "know" that the lfclck is being used for the usbd functionality since there is no link between those two? I assume that lfclk is used for the usb module because when I remove this part the USB does not function :)
2. I don't understand the USBD_POWER_DETECTION part. If I place directly the app_usbd_enable(); and app_usbd_start(); directly in the code without the if case, the device is recognized as before without issues. So, why does if (USBD_POWER_DETECTION) case exist? Also from the event handling function I see that the same app_usbd_start()/enable(); functions are being used so what is the difference and why this if/else case is being used in the first place?
3. If I place an nrf_delay_ms(500) after the usbd_cdc_acm_write the device appears in the device manager, the terminal app I use is successfully connected to the device ( LED 2 = ON) but data do not appear on the terminal display and LED 4 is always off.
4. If I erase the previous part included in if(m_send_flag) and I just replace it with the following part to send cntr value (just a counter for test) every 150msec to the PC terminal app
the device is not recognized at all. Why is this happening
Best regards
Thank you for your time!