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.

cc2538 usb_uart

Other Parts Discussed in Thread: CC2538

Hi, how to use the cc2538 as gateway usb??

  • Hi,

    I would recommend you use ZNP workspace on Z-stack Home 1.2.0 and the USB port on the 2538EM, not the one on the SmartRF06.

    Please see this post for more details http://e2e.ti.com/support/wireless_connectivity/f/158/p/337372/1181556.aspx#1181556

    Thanks,

    TheDarkSide

  • Hi,TheDarkSide

    Thanks for your reply, I read the page and would like to know if it is possible to join the ZNP USB drivers in order to use HAL_UART_USB, is it possible? could you tell me how to do? since it is still an experimental feature was exactly what I wanted to do, use the cc2538 as a gateway usb_uart / zigbee.

  • Hi Italo,

    In order to use HAL_UART_USB, you need to enable it in compile time options as shown below and rebuild the driver. This will enable the USB CDC feature on CC2538 ZNP.

    Thanks,

    Saurabh

  • Not only the ZNP project but any other project can use the USB CDC.

    I tested SimpleSwitch use the USB CDC and succed to connect to the Z-Tool.

    I also want to make a gateway program after building my own cc2538 board.

    ■ To build in order to support USB CDC. (I assume that you use the IAR compiler)

    1. Add HAL_UART_USB in the Defined Symbol

    2. Add the followings in the Additional Include directories

        $PROJ_DIR$\..\..\..\..\..\Components\usblib\cc2538\source\library

        $PROJ_DIR$\..\..\..\..\..\Components\usblib\cc2538\source\library\cc2538

        $PROJ_DIR$\..\..\..\..\..\Components\usblib\cc2538\source\class_cdc

    3. Add the followings in the Additional libraries

       $PROJ_DIR$\..\..\..\..\..\Components\usblib\cc2538\bin\iar\usblib.lib

       $PROJ_DIR$\..\..\..\..\..\Components\usblib\cc2538\bin\iar\usbcdc.lib

     

    4. Build the project & ignore the warnning

    USB_SETUP_MAX_NUMBER_OF_INTERFACES is not defined

    (The default value is used automatically)

    ■ To connect to Z-Tool

    5. Connect the USB in the CC2538EM module (not the SmartRF06EB's USB)

    6. Install the USB CDC driver in the cc2538_foundation_firmware_1_0_1_0

    7. Check out the virtual com port in the device manager.

    8. Connect the Z-tool with the previously checked com port.

        (If you can't find USB CDC com port, then check the USB line connection and the downloaded program is correct to support USB CDC.

        Because of the USB CDC code's incompleteness, the baudrate is not important, any values are working)

     

    ■ To build gateway use USB CDC

    : Through the Z-Tool's response, make your own program (Refer the linux ZLL gateway sample code)

    Or you want to use the Z-Tool's library, then just contact to the TI. (Refer the Z-Tool help)

  • Hi,

    I did setp 1, 2 and 3.

    But when  after build the project, I have the warnig and more 7 erros:

    --> Error[Li005]: no definition for "usbfwResetHandler"

    --> Error[Li005]: no definition for "usbfwSetupHandler"

    --> Error[Li005]: no definition for "usbirqData"

    --> Error[Li005]: no definition for "usbfwInit"

    --> Error[Li005]: no definition for "UsbDplusPullUpEnable" ...

    What are missing?

     

  • Hi,

    Seems like all paths need to be corrected - example:

    $PROJ_DIR$\..\..\..\..\..\Components\usblib\cc2538\source\library

    should be

    $PROJ_DIR$\..\..\..\..\Components\usblib\cc2538\source\library

    Make this correction for all steps .

    Saurabh

  • Hi Saurabh Narang,

    If the path is wrong, I think that the error report should be like --> "Fatal Error[Pe1696]: cannot open source file "hw_usb_aliases.h" ... "

    Am I right?

     

  • Hi,

    The problem was on library path....   --> $PROJ_DIR$\..\..\..\..\..\Components\usblib\cc2538\bin\iar\usbcdc.lib

    So, problem solved....

    Thanks

     

  • Hi Pe Lopex,

    i add cdc file and lib in my project, but the prolem is still there. can you tell me the detail to solve this problem. thanks

    my setting

    $PROJ_DIR$\..\..\..\..\..\Components\usblib\cc2538\source\library
    $PROJ_DIR$\..\..\..\..\..\Components\usblib\cc2538\source\library\cc2538
    $PROJ_DIR$\..\..\..\..\..\Components\usblib\cc2538\source\class_cdc
    $PROJ_DIR$\..\..\..\..\..\Components\usblib\cc2538\bin\iar\usblib.lib
    $PROJ_DIR$\..\..\..\..\..\Components\usblib\cc2538\bin\iar\usbcdc.lib

  • I Kmi_hu..


    Did you add library path, in right place?


    To include libray, you have to insert it on:

    1º Go to Projecto Optinons

    2º Select Linker category

    3º - Select Library tab.

    4º Then add the path for library.

    $PROJ_DIR$\..\..\..\..\..\Components\usblib\cc2538\bin\iar\usbcdc.lib

    $PROJ_DIR$\..\..\..\..\..\Components\usblib\cc2538\bin\iar\usblib.lib


    Make sure you that the path is correct. (You can use the tool to get manualy the path). If the path isn't right the library will not be included.

  • Hi Pe Lopez,

    Thank you for your help, I solve this problem

    thanks

  • Hello,
    Thanks for the detailed answer. It helped me to connect my Smart Energy "simple meter" device to my PC, via the EM's USB port, as a virtual serial port.

    I have an unusual problem that I can't solve:

    The ESP in the same project does not connect properly. I have followed all your steps above, but when I plug in the USB cable, it connects very briefly to the PC, and then disconnects itself. The device manager in windows shows this.

    I think that during my development on this ESP, I have disabled something that the USB module needs. Do you perhaps know what that might be? Are there maybe some defined symbols that are not able to be active at the same time as others?

    Thanks for your time and consideration.
  • I have since discovered what caused the condition stated in my last post: One of the USB data pins is connected to Port C0 (LED1 on the SmartRF06EB). When I powered up my device, i had the LED to flash to show some initialization, and consequently the data line on the USB received a brief high signal and disabled itself, probably some sort of safety function. So, when using the USB port, portC0 cannot be used for anything as it is needed by the USB module.