infineon4engi@twitter infineon@linkedin infineon4engineers infineon@youtube
twitter Facebook Linkedin Youtube

+ Reply to Thread
Results 1 to 3 of 3

Thread: DMA destination address for USB VCOM, xmc4500 with Dave 4.4.2

  1. #1
    Beginner Beginner Gertvb is on a distinguished road
    Join Date
    May 2019
    Location
    South Africa
    Posts
    6
    Points
    82.5

    DMA destination address for USB VCOM, xmc4500 with Dave 4.4.2

    Good Day!

    Dave 4.4.2 & XMC4500 relax lite

    I have an app where I continiously sample 6 inputs on the ADC and transfer their values to memory via DMA, which is all set up nicely and working like a charm, all using DAVE APPS.

    With the ADC values I then do a whole bunch of calculations and then use USBD_VCOM_Sendstring() to write the result values to a virtual serial port on the PC.

    The above all works fine, I just don't need and want to go through the whole slow process of formatting the resulting integer data into a string with snprintf.

    Thus my question:

    What is the correct hardware destination address for the USB VCOM that I have to use in setting up the DMA APP? so I can transfer calculated integer values from RAM to the virtual USB serial port

    Kind regards

    Gert

    Click image for larger version

Name:	DMA destination address.png
Views:	4
Size:	57.7 KB
ID:	4573

  2. #2
    Beginner Beginner GaryKercheck is on a distinguished road
    Join Date
    Dec 2019
    Posts
    2
    Points
    80
    Gert,

    I understand your question but using DMA to write to the USB endpoint buffer is not going to output data over the USB serial port.
    A USB transfer requires a series of writes to a number of USB control registers and memory locations. The proper way to do what you want
    to do is to use USBD_VCOM_SendBytes(). See function below:

    USBD_VCOM_STATUS_t USBD_VCOM_SendBytes(uint8_t *bArray, int bCount)
    {
    int i = 0;
    USBD_VCOM_STATUS_t status = USBD_VCOM_STATUS_SUCCESS;

    while ((bCount--) && (status == USBD_VCOM_STATUS_SUCCESS))
    {
    status = USBD_VCOM_SendByte(bArray[i++]);
    }

    return status;
    }


    Just for reference, the memory location used to output data from the device to the host PC is defined by the variable "XMC_USBD_EP_IN_BUFFER[]". This array must be located in SDRAM.
    This array defines the memory buffers for all the USB endpoints that write in the IN direction (to the PC). But again, putting that address in the DMA address location called "Destination" that you
    have the red box over is NOT going to write characters out to the serial port.

    Rgds,

    Gary
    Last edited by GaryKercheck; Mar 24th, 2020 at 12:09 PM.

  3. #3
    Beginner Beginner Gertvb is on a distinguished road
    Join Date
    May 2019
    Location
    South Africa
    Posts
    6
    Points
    82.5
    Thanks Gary!

    Thats more or less the conclusion I also arrived at, was just hoping that I could offload the stuff dealing with the USB to the DMA so I could have more cycles available for the processor.

    Will propably just change my hardware design to include something like an FTDI232 chip connected to a UART port on the XMC4500 and just dump the data via DMA to the UART register
    and have the FTDI worry about the complexities of speaking USB

    Kind regards

    Gert

+ Reply to Thread
Disclaimer

All content and materials on this site are provided “as is“. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.


Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.


Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.