41.25 UDPHS DMA Channel Status Register

Channel 0 is not used.
Name: UDPHS_DMASTATUSx
Offset: 0x031C + (x-1)*0x10 [x=1..7]
Reset: 0x00000000
Property: Read/Write

Bit 3130292827262524 
 BUFF_COUNT[15:8] 
Access R/WR/WR/WR/WR/WR/WR/WR/W 
Reset 00000000 
Bit 2322212019181716 
 BUFF_COUNT[7:0] 
Access R/WR/WR/WR/WR/WR/WR/WR/W 
Reset 00000000 
Bit 15141312111098 
          
Access  
Reset  
Bit 76543210 
  DESC_LDSTEND_BF_STEND_TR_ST  CHANN_ACTCHANN_ENB 
Access R/WR/WR/WR/WR/W 
Reset 00000 

Bits 31:16 – BUFF_COUNT[15:0] Buffer Byte Count

This field determines the current number of bytes still to be transferred for this buffer. It is decremented from the source system bus access byte width at the end of this bus address phase.

The access byte width is 4 by default, or less, at DMA start or end, if the start or end address is not aligned on a word boundary.

At the end of buffer, the DMA accesses the UDPHS device only for the number of bytes needed to complete it.

This field value is reliable (stable) only if the channel has been stopped or frozen (the UDPHS_EPTCTLx.NT_DIS_DMA bit is used to disable the channel request) and the channel is no longer active (CHANN_ACT flag is 0).

Note: For OUT endpoints, if the receive buffer byte length (BUFF_LENGTH) has been defaulted to zero because the USB transfer length is unknown, the actual buffer byte length received is 0x10000-BUFF_COUNT.

Bit 6 – DESC_LDST Descriptor Loaded Status

Valid until the CHANN_ENB flag is cleared at the end of the next buffer transfer.

ValueDescription
0 Cleared automatically when read by software.
1 Set by hardware when a descriptor has been loaded from the system bus.

Bit 5 – END_BF_ST End of Channel Buffer Status

Valid until the CHANN_ENB flag is cleared at the end of the next buffer transfer.

ValueDescription
0 Cleared automatically when read by software.
1 Set by hardware when the BUFF_COUNT countdown reaches zero.

Bit 4 – END_TR_ST End of Channel Transfer Status

Valid until the CHANN_ENB flag is cleared at the end of the next buffer transfer.

ValueDescription
0 Cleared automatically when read by software.
1 Set by hardware when the last packet transfer is complete, if the UDPHS device has ended the transfer.

Bit 1 – CHANN_ACT Channel Active Status

When a packet transfer is ended, this bit is automatically reset.

When a packet transfer cannot be completed due to an END_BF_ST, this flag stays set during the next channel descriptor load (if any) and potentially until UDPHS packet transfer completion, if allowed by the new descriptor.

ValueDescription
0 The DMA channel is no longer trying to source the packet data.
1 The DMA channel is currently trying to source packet data, i.e., selected as the highest-priority requesting channel.

Bit 0 – CHANN_ENB Channel Enable Status

When any transfer is ended either due to an elapsed byte count or a UDPHS device initiated transfer end, this bit is automatically reset.

This bit is normally set or cleared by writing into the UDPHS_DMACONTROLx.CHANN_ENB bit either by software or descriptor loading.

If a channel request is currently serviced when the CHANN_ENB bit is cleared, the DMA FIFO buffer is drained until it is empty, then this status bit is cleared.

ValueDescription
0 The DMA channel no longer transfers data, and may load the next descriptor if the UDPHS_DMACONTROLx.LDNXT_DSC bit is set.
1 The DMA channel is currently enabled and transfers data upon request.