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.

TM4C1237D5PZ: USB CDC Serial Port

Part Number: TM4C1237D5PZ
Other Parts Discussed in Thread: EK-TM4C123GXL,

I developed long time ago an USB based application under BULK functionality, today we are adding support for serial port, while investigating our needs I was trying to use one of your examples for USB_DEV_SER for the micro in the launchpad LM4F120XL, obviously was modified to match this micro for USB pins from PortB to PortJ.

While running the code, first time falls in the IntDefaultHandler and then by resetting it in the same debug session and running it again, goes to the main execution but nothing happens.

Since I don't have experience with USB CDC for this specific micro, can you help me to know what else could be needed to make this code to work?

I'm using CCS 8

  • Hello Saul,

    The usb_dev_serial example for the EK-TM4C123GXL LaunchPad is a USB CDC example.

    You can get this from our latest TivaWare release: http://www.ti.com/tool/SW-TM4C

    And you can find the example at [Install Path]\TivaWare_C_Series-2.2.0.295\examples\boards\ek-tm4c123gxl\usb_dev_serial

  • Hi Ralph,

    Actually I tried exactly that thing, I don't know if I explained this correctly. 

    I just modified couple of lines to use PORT J in new micro as follows:

    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOJ);
    ROM_GPIOPinTypeUSBAnalog(GPIO_PORTJ_BASE, GPIO_PIN_0 | GPIO_PIN_1);

    While debugging, I'm having an issue with unexpected interruption and goes to the IntDefaultHandler loop

    I want to make sure, I'm not missing anything else for this micro TM4C1237D5PZ

  • Hello Saul,

    Have you routed the interrupt for USB0DeviceIntHandler to the USB0 peripheral in your startup_ccs.c file?

  • Ralph,

    Thanks a lot, I was able to figure out the issue, since it's the first time I'm using Code Composer as my compiler, I didn't notice that every time a target is selected in the project CCS8 generates a file for that specific micro in addition to the startup file already included in the example. I deleted the original file to take the generated one and at the end I was having a weird set of functions and definitions. So it's working now.

    Now, probably I need to open an additional question chat or hopefully you can respond in here.

    What's happening with the UART0 peripheral in the Port A (0, 1) if this was redirected to the USB0 like in the example. Are both responding or USB takes priority inhibiting the Port A to work as UART port.

    Basically my original project uses UART0 as the default UART, but in case something is crashing internally or inhibiting the port I can make use of any other UART available.

    Regards,

    Saul

  • Hi Saul,

    I'm not quite clear with what you are asking here. The way that is setup in the code is that UART0 is used to print USB data on the terminal, so they work together hand in hand. The USB peripheral gets data, alerts the application, and then the application reads the USB data received from the buffer and sends it out over UART.

    I don't see it as: 

    Saul Espinosa said:
    Are both responding or USB takes priority inhibiting the Port A to work as UART port.

    I'll also mention this is only for data display for demonstration purposes and may not be very useful for an actual end application.

  • Ralph,

    Thanks for helping me to understand the example, actually my application does something similar with the USB as Bulk device, just some pre processing is needed.

    That description is really helping me to keep the new implementation as easy as it can be.

    Best regards

    Saul