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
  • > 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).

    Ya, USBEpDMAEn register is write-only. Reading from this register does't have any meaning. USBEpDMASt holds the result of write to USBEpDMAEn. Once enabled by USBEpDMAEn, the status (enabled/disabled) doesn't change until your firmware disables it by writing to USBEpDMADis.

    > I enable the DMA on the EP when I receive the Set Interface command from the Host.

    Here is the bus traffic of a USB microphone, running on Windows XP
    At the end of enumeration, two Set_Interface( alternate:0 ) are seen.

    // enumeration - last part
    [6.393,395] FS: Control Transfer Addr:07 Endp:0 - Set Configuration (0x01)
    [6.464,475] FS: Control Transfer Addr:07 Endp:0 - Set Interface 1 to 0     // <------
    [6.475,128] FS: Control Transfer Addr:07 Endp:0 - Get String Descriptor 0
    [6.478,213] FS: Control Transfer Addr:07 Endp:0 - Get String Descriptor 2
    [6.481,535] FS: Control Transfer Addr:07 Endp:0 - Get String Descriptor 0
    [6.485,039] FS: Control Transfer Addr:07 Endp:0 - Get String Descriptor 2
    [6.492,961] FS: Control Transfer Addr:07 Endp:0 - Get String Descriptor 0
    [6.495,275] FS: Control Transfer Addr:07 Endp:0 - Get String Descriptor 2
    [6.497,541] FS: Control Transfer Addr:07 Endp:0 - Set Interface 1 to 0     // <------
    


    When Audacity, an audio recording application, starts up, this app issues two pairs of Set_Interface( alternate:1/0 )

    // Audacity starts up
    [12.089,038] FS: Control Transfer Addr:07 Endp:0 - Set Interface 1 to 1    // <------
    [12.138,837] FS: Control Transfer Addr:07 Endp:0 - Set Interface 1 to 0    // <------
    [13.383,604] FS: Control Transfer Addr:07 Endp:0 - Set Interface 1 to 1    // <------
    [13.411,127] FS: Control Transfer Addr:07 Endp:0 - Set Interface 1 to 0    // <------
    

    At "Start Monitoring", Set_Interface( alternate:1 ) is issued, and isoc transactions start

    // Start Monitoring
    [22.678,272] FS: Control Transfer Addr:07 Endp:0 - Set Interface 1 to 1    // <------
    
    [22.718,957] FS: Data Transfer (Isochronous-IN) Addr:07 Endp:1 - Audio Stream
    [22.719,957] FS: Data Transfer (Isochronous-IN) Addr:07 Endp:1 - Audio Stream
    ...
    Isoc INs continue
    ...
    

    At "Stop Monitoring", isoc transactions stop, and Set_Interface( alternate:0 ) is issued.

    // Stop Monitoring
    [27.268,106] FS: Data Transfer (Isochronous-IN) Addr:07 Endp:1 - Audio Stream
    [27.269,106] FS: Data Transfer (Isochronous-IN) Addr:07 Endp:1 - Audio Stream
    
    [27.277,759] FS: Control Transfer Addr:07 Endp:0 - Set Interface 1 to 0    // <------
    

    In this way, Set_Interface() is issued many times, before isoc transfer actually starts.
    We have to count in this fact on coding.

    Tsuneo

Reply
  • > 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).

    Ya, USBEpDMAEn register is write-only. Reading from this register does't have any meaning. USBEpDMASt holds the result of write to USBEpDMAEn. Once enabled by USBEpDMAEn, the status (enabled/disabled) doesn't change until your firmware disables it by writing to USBEpDMADis.

    > I enable the DMA on the EP when I receive the Set Interface command from the Host.

    Here is the bus traffic of a USB microphone, running on Windows XP
    At the end of enumeration, two Set_Interface( alternate:0 ) are seen.

    // enumeration - last part
    [6.393,395] FS: Control Transfer Addr:07 Endp:0 - Set Configuration (0x01)
    [6.464,475] FS: Control Transfer Addr:07 Endp:0 - Set Interface 1 to 0     // <------
    [6.475,128] FS: Control Transfer Addr:07 Endp:0 - Get String Descriptor 0
    [6.478,213] FS: Control Transfer Addr:07 Endp:0 - Get String Descriptor 2
    [6.481,535] FS: Control Transfer Addr:07 Endp:0 - Get String Descriptor 0
    [6.485,039] FS: Control Transfer Addr:07 Endp:0 - Get String Descriptor 2
    [6.492,961] FS: Control Transfer Addr:07 Endp:0 - Get String Descriptor 0
    [6.495,275] FS: Control Transfer Addr:07 Endp:0 - Get String Descriptor 2
    [6.497,541] FS: Control Transfer Addr:07 Endp:0 - Set Interface 1 to 0     // <------
    


    When Audacity, an audio recording application, starts up, this app issues two pairs of Set_Interface( alternate:1/0 )

    // Audacity starts up
    [12.089,038] FS: Control Transfer Addr:07 Endp:0 - Set Interface 1 to 1    // <------
    [12.138,837] FS: Control Transfer Addr:07 Endp:0 - Set Interface 1 to 0    // <------
    [13.383,604] FS: Control Transfer Addr:07 Endp:0 - Set Interface 1 to 1    // <------
    [13.411,127] FS: Control Transfer Addr:07 Endp:0 - Set Interface 1 to 0    // <------
    

    At "Start Monitoring", Set_Interface( alternate:1 ) is issued, and isoc transactions start

    // Start Monitoring
    [22.678,272] FS: Control Transfer Addr:07 Endp:0 - Set Interface 1 to 1    // <------
    
    [22.718,957] FS: Data Transfer (Isochronous-IN) Addr:07 Endp:1 - Audio Stream
    [22.719,957] FS: Data Transfer (Isochronous-IN) Addr:07 Endp:1 - Audio Stream
    ...
    Isoc INs continue
    ...
    

    At "Stop Monitoring", isoc transactions stop, and Set_Interface( alternate:0 ) is issued.

    // Stop Monitoring
    [27.268,106] FS: Data Transfer (Isochronous-IN) Addr:07 Endp:1 - Audio Stream
    [27.269,106] FS: Data Transfer (Isochronous-IN) Addr:07 Endp:1 - Audio Stream
    
    [27.277,759] FS: Control Transfer Addr:07 Endp:0 - Set Interface 1 to 0    // <------
    

    In this way, Set_Interface() is issued many times, before isoc transfer actually starts.
    We have to count in this fact on coding.

    Tsuneo

Children
More questions in this forum