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.

Control USB DMA(Receive) , Stop and Restart

Other Parts Discussed in Thread: AM3352

hi all, ~

I have been using Sitara AM3352 Custom Board.

I tried USB Rx Control  Stop and Restart

Assumed , endpoint 3,  HOST(PC) -> DEVICE(AM3352) transfer, endpoint 512bytes,CPPI DMA transparent Mode

When continuos usb data receive(512kb) , If i want stop temporarily usb receive Interrupt and immediately restart.

How should I operate?

 

  • Hi Yul lee,

    For transparent mode of operation we queue up cppi BDs for every 512 bytes. You would need to put a counter on the number of bytes received and stop queuing up any more BDs. I don't see any graceful way of doing it. Could you please describe the context ?  

  • thanks reply~

    At the same time I used multiple interrupts. DmTimer, DmTimer PWM, SPI edma, ehrPWM, USB.

    If the USB transfer is accepted at this moment. Other Interrupts are unstable.

    Therefore USB Interrupt Priority is lowest (5). 

    Depending on the circumstances, I should stop for a moment the USB interrupt.

    And When an interrupt is not complicated, usb transmission resumes.

    I wonder when the receive transfer CPPI DMA . What do I need to manipulate the register?

    I think that these registers are associated

     

    USBSS - IRQENABLER, IRQDMAENABLE0, IRQDMAENABLE1

    USB0 - USB0IRQENABLESET0, USB0IRQENABLESET1

    CPPI_DMA - RXGCRx

    CPPI_DMA_SCHEDULER - DMA_SCHED_CTRL,

    or

    USB_CORE - USBRXIE, USBRXCSRLx ,USBRXCSRHx etc...

     

    But I do not know exactly. What should I do?

     

    Now  I tried SET and CLEAR  USB0IRQENABLESET0  RXEP3 bit..

    But That the operation is unstable.

    When an interrupt is busy. usb transfer is stopped and sometimes discarded.

    Stopping point is the red bold part.

    Maybe RXRDY of RXCSRL bit is not cleared.

     

    void disableCoreRxDMA(unsigned short usbDevInst, unsigned int ulEndpoint)

    {

        unsigned int ulRegister;     usbInstance *usbInstance;

        usbInstance = &(cppiInfo.usbInst[usbDevInst]);

        /*Find out the CSR offset */   

        ulRegister = USB_O_RXCSRL1 + EP_OFFSET(ulEndpoint);

        /*wait till completion of any previos transaction */    

        while ((HWREGH(usbInstance->usbBaseAddress + ulRegister) & 0x1) == 0x01);  

         /* Clear DMAReqEnab */   

        HWREGH(usbInstance->usbBaseAddress + ulRegister)&= CPDMA_RX_CLR_REQ_ENABLE;

    }

     

    What should I do?

    help me

    thanks.