This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

USB in DMA mode

Hi every body
I want to get data from PC and store in arm memory and after process sent by ssp.
I use usb_cdc mode and i can't initialize usb in DMA mode.
I use uvision 5 and the project is here:
Download:
www.transferbigfiles.com/.../9MUgnGGqw9o8a39vyHIdUA2

Parents
  • > 1- I want to send data from PC via usb (cdc_mode) 64Byte packet to hardware, witch endpoint i should enable? out or in (I use EP2 and set endpoint 2 out)

    As USB is host-centric,
    OUT: host -> device
    IN: device -> host

    OUT EP2 (logical) = physical EP 4
    "#define USB_DMA_EP 0x00000010" is right definition for this endpoint.

    >2- I use the code below in USB_EndPoint2 (uint32_t event) and always the first event is "USB_EVT_OUT_DMA_ERR" what is the reason?
    > 3- Is USBDMARSet set correct?

    The first "event" of this OUT EP should be NDDR (USB_EVT_OUT_DMA_NDR)
    But your code assigns "USB_EVT_IN_DMA_NDR" case to it. Replace "IN" to "OUT"
    Also, "LPC_USB->USBDMARSet |= 0x20;" is not required for the OUT endpoint.

    Tsuneo

Reply
  • > 1- I want to send data from PC via usb (cdc_mode) 64Byte packet to hardware, witch endpoint i should enable? out or in (I use EP2 and set endpoint 2 out)

    As USB is host-centric,
    OUT: host -> device
    IN: device -> host

    OUT EP2 (logical) = physical EP 4
    "#define USB_DMA_EP 0x00000010" is right definition for this endpoint.

    >2- I use the code below in USB_EndPoint2 (uint32_t event) and always the first event is "USB_EVT_OUT_DMA_ERR" what is the reason?
    > 3- Is USBDMARSet set correct?

    The first "event" of this OUT EP should be NDDR (USB_EVT_OUT_DMA_NDR)
    But your code assigns "USB_EVT_IN_DMA_NDR" case to it. Replace "IN" to "OUT"
    Also, "LPC_USB->USBDMARSet |= 0x20;" is not required for the OUT endpoint.

    Tsuneo

Children
No data