I am trying to run the USB CDC ACM example on macOS 10.12.6. Following the instructions in the example app, I should see a virtual COM port as /dev/ttyACMx when I connect both the USB and J-link ports to my Mac. I am running the example on the nRF52840-DK board with the 15.3.0 SDK. Unfortunately all I see are two usbmodem ports: /dev/cu.usbmodem14111 and /dev/cu.usbmodem14121. I have tried on two different macOS laptops.
When I use the "screen" utility connected to one of the usbmodem ports and run the USB CDC ACM example with SEGGER Embedded Studio, I do see the CLI interface in the terminal and I can send data from the terminal to the app. But when I press Button 1, the call to app_usbd_cdc_acm_write() fails with NRF_ERROR_INVALID_STATE. Presumably this is because the virtual COM port has not been opened.
From what I've read, the virtual COM port should become available automatically on both macOS and Linux when I connect both the J-Link and nRF USB ports to my Mac. I also tried connecting the board to my Ubuntu 18.04.1 machine and don't see the virtual COM port there either. Searching through the DevZone, I found a related post that suggested installing the J-Link 6.22g package. I tried that as well and unfortunately that didn't resolve this issue either.
Based on these results, I'm guessing I am missing something obvious. Are there additional steps, switch/jumper configurations, etc... required to enumerate the virtual COM port on macOS? Also, assuming we are able to resolve this issue, is it still the case that we would need to write a NRF_LOG backend for USB to route NRF_LOG data through the virtual COM port?
It is correct that you see the port as usbmodem ports on MacOS. It might be that you are connected to SEGGER VCOM when you see the CLI interface. Can you check if this is the case? What version of the nRF52840-DK board do you have? Do you use a preview DK maybe?
You can check if the SEGGER VCOM is enabled via the JLink Configurator. Use the link in my previous answer, under "Via J-Link Configurator" you can see how the VCOM is enabled/disabled.
No, Rev 1.1.1 isn't a PDK. On MacOX the port should come up as usbmodem while on Linux it should come up as ACMx. It is weird that it doesn't show up as ACMx on Linux though.
Can you try disable the VCOM and try again? If possible can you try with another board too?
Thank you for sticking with me. I was able to install and launch the J-Link Configurator app on both macOS and Linux. As you suggested, the VCOM post was enabled, so I disabled the port. That seems to have resolved the issue. The call to app_usbd_cdc_acm_write() no longer fails and I see the output in the serial console. I also now see /dev/ttyACM0 on Linux.
I would suggest updating the example app documentation to note that the virtual COM port enumerates as "usbmodemX" on macOS. Also it might help others to note that the SEGGER VCOM port needs to be disabled in order for this example app to work properly.
Anyway, thanks again for your help.