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.

MSP430F5529: UART-to-USB CDC bridge

Part Number: MSP430F5529

Good day to all of you!

I'm trying to make a tool for log redirection through msp430f5529 on a custom board.

Log comes to UART0 at 115200 baudrate. It is quite a chunk of text, 135kbytes to be precise.

The idea is to send it through to PC via USB CDC.

The clock runs at 24MHz, driven by DCO. There's an 8MHz XT2 installed for USB.

Now, the problem is, msp's drowning in incoming data and fails to process all of it. My guess is that UCA0RX interrupt blocks usb api from working correctly, so i thought of possible ways of speeding things up.

DMA seems an obvious solution, but i'm completely new to it, especially when it comes to USB, so i don't see a proper way to actually apply it.

I currently have a non-DMA circle buffer, but it can't keep up with incoming data.

Can someone please provide help/example on how to deal with such a problem or how I can properly use dma on USB API so it actually saves time?

  • Hi Konstantin,

    Are you able to transfer these bytes in different chunks? or are you getting a constant stream? An idea would be to setup some communication to tell the other device to wait a little before sending the next set. You could send a packet in the UART for a pause, then another for go. A GPIO toggle would be another idea, a simple if its on pause. 

    For better speed:

    The DMA would be a good idea for this, an example can be found here MSP430F55xx_dmaa_02.c. I would also suggest reading Section 11 in the User's Guide to get a better understanding of the DMA and how to operate it.

    Use a DMA ping pong to have two buffers so the UART will fill one buffer, then once buffer 1 is filled, USB will retrieve data from buffer 1 and UART can start filling buffer 2.

    The UART will be the bottleneck here as the USB module runs faster than the UART. Since there is 8KB of SRAM on the part I would use about half of it on this operation, which would mean each buffer is 2KB in size. It will take some testing to fine tune it to your system requirements but hopefully this was helpful to get an idea.

    Regards,

    Luke

  • I made this (but based on my own USB stack, not TI source) and found that DMA can't speed things up. At the end, device (MSP430F550X) running on 24 MHz MCLK was able to  do dual CDC bridge (one way only, not full duplex) transfer at 4 Mbps (without using DMA).

**Attention** This is a public forum