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

Question about virtual com port

I have a technical issue I am facing while doing development with Nordic NRF52840. I have an application which I am sending command though virtual com port using CDC ACM USB class. When the application is running the COM port shows as Port 30 on my windows. When I switch to my bootloader which also uses virtual com port using CDC ACM USB class, the port changes to 29 . Why the port is not remaining the same in both app and bootloader mode. Is there a way that the port number remains the same when I switch from my application to my bootloader application

In my sdk_config.h file I have same vendor and product ID. // Vendor ID ordered from USB IF: www.usb.org/.../ #ifndef APP_USBD_VID #define APP_USBD_VID 0x1915 #endif

// APP_USBD_PID - Product ID

// Selected Product ID #ifndef APP_USBD_PID #define APP_USBD_PID 0x520F #endif

  • Hi,

    Are you always using the nRF USB port, or are you also using the Segger J-Link USB port?

    Also please provide some more information.

    • What SDK version are you using?
    • What version of the nRF52840 PDK are you using? It should be printed below PCA10056 on the sticker on the kit.
    • Do you have more than 1 nRF52840-PDK you can test with?
    • Do you have custom boards using "engineer samples" ?

    If you are using engineer samples:

    • How many of these custom boards with engineer samples do you have ?
    • What is the build code on the engineer samples?
  • Hi,

    I am using nRF USB port, although I do have the J-Link connected to flash my code using Keil. I am using SDK version 13.1.0. The PDK Version is V0.9.2 (2017.33). No, I don't have any other PDK No, I do not have custom board with engineering sample.

  • Have you written your own USB bootloader code?

    Note that we in SDK 14 added a USB CDC ACM Secure DFU Bootloader example. You might want to use that instead ? It can be found in the folder SDK14_folder\examples\dfu\experimental_bootloader_secure_usb

  • I found the issue. The app_usbd_string_config.h was different in both bootloader code and application code . That's the reason the port coming up was different for bootloader and app. After I changed the config file to have the same values for both the bootloader and the app code , they both are showing up as the same port. I have one question for you: Can I write my own bootloader using usb using sdk 13.1. Or there is some restriction that it will not work unless I have sdk 14.x

  • I’m glad to hear that COM port issue have been solved. There is nothing that prevents you from writing your own bootloader with SDK 13. But since we have added a USB bootloader in SDK 14, you could save yourself a lot of time by upgrading and using that instead. You should at least take a look at it.

    Regarding the USB driver/library, this is still labeled as experimental and considered a “work in progress”, until the production variant of the nRF52840 is released. Also note there is a lot of overall improvement of the USB driver in SDK 14.1. But since it’s still a “work in progress”, this means that the code base and APIs will change in-between SDK versions and will not necessarily be backwards compatible.

Related