This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

cc2540 USB dongle UART and virtual usb(COM PORT)

Other Parts Discussed in Thread: CC2540

Hello,

I want to know if it is possible to use the virtual USB COM port and the UART0 alt1 at the same time.

I searched 1 week and read many about it but could not find any solution.

I am using the cc2540 USB dongle and programmar on the base of Host... test.

Thankyou 

  • Hi Paul,

    Yes you may. I assume you want to use USB for HCI commands, so just set that up as normal.

    Then you need to take the _hal_uart_dma.c code and use it directly, i.e. not via NPI / TL. So open it directly etc.

    You probably have to take it and make your own version with different defines to make it independent from the HCI stuff.

    Otherwise, if the driver is too complex, feel free to use the hardware module directly. See the 2540 User's Guide on how to do that.

    Aslak

  • What do you mean by "set that up as normal"?

    I have a project that used UART to communicate with another micro. That data is then process for use over bluetooth. Now I have to add USB support as well. Is there a simple setup to add USB support on my currently working workspace?

  • Hi Ronald,

    The normal case is that a UART driver is present in the project, and that the NPI / HCI layer will take ownership of it. This is in network processor mode.

    If you have two UART needs that are not related to network processing interface, then you can add the USB driver files as they are used in the project HostTestApp for CC2540 with the build config CC2540USB selected.

    Note that with two UART implementations added, you can't really use the hal_uart.c 'interface' for USB (assuming you are using it for the other UART) because via defines it will only act on one implementation.

    But if you add the USB files as in that project, and for example make a copy of hal_uart.c where you retain only the pieces relating to USB (and change the function names so they don't collide with hal_uart.c), i think that should work.

    Unfortunately we don't have a step-by-step for this.

    Best regards,
    Aslak