LPC1769 USB DMA Mode

Hi,
I am currently using IN EP3 of the LPC1769 to realize Isochronous transactions to the Host. I have configured the this endpoint in the DMA mode

 LPC_USB->EpDMAEn   = 0x80;

I enable the DMA on the EP when I receive the Set Interface command from the Host. However, I see that the EpDMAEn does not change its value to 0x80 as desired (this could probably be because the register is Write Only, but I am not sure).
Please can someone let me know the conditions under which the DMA mode for the EP would get disabled?

In order to get around this problem I write to the above register everytime I create a DMA Descriptor. Is this a good method? Many time we end up loosing bytes of information on the host but I am not sure if it is actually because of this.

Any help in this regard would be much appreciated.

Thanks very much.

Regards,
Shaunak

Parents Reply
  • Umm.. UHCI..
    UHCI driver on Windows often has this error code problem.

    Windows USBDI defines error code following to OHCI spec.
    Here is USBDI error code definitions,

    source.winehq.org/.../usb.h
    
     92 #define USBD_STATUS_CRC                              ((USBD_STATUS)0xC0000001)
     93 #define USBD_STATUS_BTSTUFF                          ((USBD_STATUS)0xC0000002)
     94 #define USBD_STATUS_DATA_TOGGLE_MISMATCH             ((USBD_STATUS)0xC0000003)
     95 #define USBD_STATUS_STALL_PID                        ((USBD_STATUS)0xC0000004)
     96 #define USBD_STATUS_DEV_NOT_RESPONDING               ((USBD_STATUS)0xC0000005)
     97 #define USBD_STATUS_PID_CHECK_FAILURE                ((USBD_STATUS)0xC0000006)
     98 #define USBD_STATUS_UNEXPECTED_PID                   ((USBD_STATUS)0xC0000007)
     99 #define USBD_STATUS_DATA_OVERRUN                     ((USBD_STATUS)0xC0000008)
    100 #define USBD_STATUS_DATA_UNDERRUN                    ((USBD_STATUS)0xC0000009)
    101 #define USBD_STATUS_RESERVED1                        ((USBD_STATUS)0xC000000A)
    102 #define USBD_STATUS_RESERVED2                        ((USBD_STATUS)0xC000000B)
    103 #define USBD_STATUS_BUFFER_OVERRUN                   ((USBD_STATUS)0xC000000C)
    104 #define USBD_STATUS_BUFFER_UNDERRUN                  ((USBD_STATUS)0xC000000D)
    105 #define USBD_STATUS_NOT_ACCESSED                     ((USBD_STATUS)0xC000000F)
    

    And here is Completion Codes list on OHCI spec ( download.microsoft.com/.../hci_1.exe )

    Table 4-7: Completion Codes (p32)
    
    Code Meaning
    0000 NOERROR
    0001 CRC
    0010 BITSTUFFING
    0011 DATATOGGLEMISMATCH
    0100 STALL
    0101 DEVICENOTRESPONDING
    0110 PIDCHECKFAILURE
    0111 UNEXPECTEDPID
    1000 DATAOVERRUN
    1001 DATAUNDERRUN
    1010 reserved
    1011 reserved
    1100 BUFFEROVERRUN
    1101 BUFFERUNDERRUN
    111x NOT ACCESSED
    

    Apparently, USBDI error code definition derives from OHCI Completion Codes
    On the other hand, UHCI spec gives the error in bitmap.
    download.intel.com/.../uhci11d.pdf

    3.2.2 TD CONTROL AND STATUS (DWORD 1: 04-07h) (p22)
    
    Bit Status Field Description
    23 Active
    22 Stalled
    21 Data Buffer Error
    20 Babble Detected
    19 NAK Received
    18 CRC/Time Out Error
    17 Bitstuff Error
    16 Reserved (R).
    

    UHCI implementation has to interpret this bitmap into USBDI error code
    And some bugs get mixed in this interpretation.

    Do you have the source code of the UHCI driver?

    Tsuneo

Children
More questions in this forum