72.20 UDPHS Endpoint Status Register (Isochronous Endpoint)

This register view is relevant only if UDPHS_EPTCFGx.EPT_TYPE = 0x1.

Name: UDPHS_EPTSTAx
Offset: 0x011C + x*0x20 [x=0..15]
Reset: 0x00000040
Property: Read-only

Bit 3130292827262524 
 SHRT_PCKTBYTE_COUNT[10:4] 
Access RRRRRRRR 
Reset 00000000 
Bit 2322212019181716 
 BYTE_COUNT[3:0]BUSY_BANK_STA[1:0]CURBK[1:0] 
Access RRRRRRRR 
Reset 00000000 
Bit 15141312111098 
  ERR_FLUSHERR_CRC_NTRERR_FL_ISOTXRDY_TRERTX_COMPLTRXRDY_TXKLERR_OVFLW 
Access RRRRRRR 
Reset 0000000 
Bit 76543210 
 TOGGLESQ_STA[1:0]       
Access RR 
Reset 01 

Bit 31 – SHRT_PCKT Short Packet (cleared upon USB reset)

An OUT Short Packet is detected when the receive byte count is less than the configured UDPHS_EPTCFGx register EPT_Size.

This bit is updated at the same time as the BYTE_COUNT field.

This bit is reset by UDPHS_EPTRST register EPT_x (reset endpoint) and by UDPHS_EPTCTLDISx (disable endpoint).

Bits 30:20 – BYTE_COUNT[10:0] UDPHS Byte Count (cleared upon USB reset)

Byte count of a received data packet.

This field is incremented after each write into the endpoint (to prepare an IN transfer).

This field is decremented after each reading into the endpoint (OUT transfer).

This field is also updated at RXRDY_TXKL flag clear with the next bank.

This field is also updated at TXRDY_TRER flag set with the next bank.

This field is reset by EPT_x of UDPHS_EPTRST register.

Bits 19:18 – BUSY_BANK_STA[1:0] Busy Bank Number (cleared upon USB reset)

These bits are set by hardware to indicate the number of busy banks.

IN endpoint: It indicates the number of busy banks filled by the user, ready for IN transfer.

OUT endpoint: It indicates the number of busy banks filled by OUT transaction from the Host.

ValueNameDescription
0 0BUSYBANK

All banks are free

1 1BUSYBANK

1 busy bank

2 2BUSYBANKS

2 busy banks

3 3BUSYBANKS

3 busy banks

Bits 17:16 – CURBK[1:0] Current Bank (cleared upon USB reset)

These bits are set by hardware to indicate the number of the current bank.

The current bank is updated each time the user:

  • Sets the TX Packet Ready bit to prepare the next IN transfer and to switch to the next bank.

  • Clears the received OUT data bit to access the next bank.

This bit is reset by UDPHS_EPTRST register EPT_x (reset endpoint) and by UDPHS_EPTCTLDISx (disable endpoint).

ValueNameDescription
0 BANK0

Bank 0 (or single bank)

1 BANK1

Bank 1

2 BANK2

Bank 2

Bit 14 – ERR_FLUSH Bank Flush Error (cleared upon USB reset)

For High Bandwidth Isochronous IN endpoints.

This bit is set when flushing unsent banks at the end of a microframe.

This bit is reset by UDPHS_EPTRST register EPT_x (reset endpoint) and by EPT_CTL_DISx (disable endpoint).

Bit 13 – ERR_CRC_NTR CRC ISO Error/Number of Transaction Error (cleared upon USB reset)

CRC ISO Error (for Isochronous OUT endpoints) (Read-only):

This bit is set by hardware if the last received data is corrupted (CRC error on data).

This bit is updated by hardware when new data is received (Received OUT Data bit).

Number of Transaction Error (for High Bandwidth Isochronous IN endpoints):

This bit is set at the end of a microframe in which at least one data bank has been transmitted, if less than the number of transactions per micro-frame banks (UDPHS_EPTCFGx register NB_TRANS) have been validated for transmission inside this microframe.

This bit is reset by UDPHS_EPTRST register EPT_x (reset endpoint) and by UDPHS_EPTCTLDISx (disable endpoint).

Bit 12 – ERR_FL_ISO Error Flow (cleared upon USB reset)

This bit is set by hardware when a transaction error occurs.

  • Isochronous IN transaction is missed, the micro has no time to fill the endpoint (underflow).
  • Isochronous OUT data is dropped because the bank is busy (overflow).

This bit is reset by UDPHS_EPTRST register EPT_x (reset endpoint) and by UDPHS_EPTCTLDISx (disable endpoint).

Bit 11 – TXRDY_TRER TX Packet Ready/Transaction Error (cleared upon USB reset)

TX Packet Ready

This bit is cleared by hardware, as soon as the packet has been sent.

For Multi-bank endpoints, this bit may remain clear even after software is set if another bank is available to transmit.

Hardware clear of this bit may generate an interrupt if enabled by the UDPHS_EPTCTLx register TXRDY_TRER bit.

This bit is reset by UDPHS_EPTRST register EPT_x (reset endpoint), and by UDPHS_EPTCTLDISx (disable endpoint).

Transaction Error (for high bandwidth isochronous OUT endpoints) (Read-Only):

This bit is set by hardware when a transaction error occurs inside one microframe.

If one toggle sequencing problem occurs among the n-transactions (n = 1, 2 or 3) inside a microframe, then this bit is still set as long as the current bank contains one “bad” n-transaction (see CURBK field description). As soon as the current bank is relative to a new “good” n-transactions, then this bit is reset.

Note:
  1. A transaction error occurs when the toggle sequencing does not comply with the Universal Serial Bus Specification, Rev 2.0 (5.9.2 High Bandwidth Isochronous endpoints) (Bad PID, missing data, etc.)
  2. When a transaction error occurs, the user may empty all the “bad” transactions by clearing the Received OUT Data flag (RXRDY_TXKL).

If this bit is reset, then the user should consider that a new n-transaction is coming.

This bit is reset by UDPHS_EPTRST register EPT_x (reset endpoint), and by UDPHS_EPTCTLDISx (disable endpoint).

Bit 10 – TX_COMPLT Transmitted IN Data Complete (cleared upon USB reset)

This bit is set by hardware after an IN packet has been sent.

This bit is reset by UDPHS_EPTRST register EPT_x (reset endpoint), and by UDPHS_EPTCTLDISx (disable endpoint).

Bit 9 – RXRDY_TXKL Received OUT Data/KILL Bank (cleared upon USB reset)

Received OUT Data (for OUT endpoint or Control endpoint):
  • This bit is set by hardware after a new packet has been stored in the endpoint FIFO.
  • This bit is cleared by the device firmware after reading the OUT data from the endpoint.
  • For multi-bank endpoints, this bit may remain active even when cleared by the device firmware, this if an other packet has been received meanwhile.
  • Hardware assertion of this bit may generate an interrupt if enabled by the UDPHS_EPTCTLx register RXRDY_TXKL bit.
  • This bit is reset by UDPHS_EPTRST register EPT_x (reset endpoint) and by UDPHS_EPTCTLDISx (disable endpoint).
KILL Bank (for IN endpoint):
  • The bank is really cleared or the bank is sent, BUSY_BANK_STA is decremented.
  • The bank is not cleared but sent on the IN transfer, TX_COMPLT
  • The bank is not cleared because it was empty. The user should wait that this bit is cleared before trying to clear another packet.
    Note: “Kill a packet” may be refused if at the same time, an IN token is coming and the current packet is sent on the UDPHS line. In this case, the TX_COMPLT bit is set. Take notice however, that if at least two banks are ready to be sent, there is no problem to kill a packet even if an IN token is coming. In fact, in that case, the current bank is sent (IN transfer) and the last bank is killed.

Bit 8 – ERR_OVFLW Overflow Error (cleared upon USB reset)

This bit is set by hardware when a new too-long packet is received.

Example: If the user programs an endpoint 64 bytes wide and the host sends 128 bytes in an OUT transfer, then the Overflow Error bit is set.

This bit is updated at the same time as the BYTE_COUNT field.

This bit is reset by UDPHS_EPTRST register EPT_x (reset endpoint) and by UDPHS_EPTCTLDISx (disable endpoint).

Bits 7:6 – TOGGLESQ_STA[1:0] Toggle Sequencing (cleared upon USB reset)

In OUT transfer, the Toggle information is meaningful only when the current bank is busy (Received OUT Data = 1).

This field is updated for OUT transfer: 

  • A new data has been written into the current bank.

  • The user has just cleared the Received OUT Data bit to switch to the next bank.

For High Bandwidth Isochronous Out endpoint, it is recommended to check the UDPHS_EPTSTAx/TXRDY_TRER bit to know if the toggle sequencing is correct or not.

This field is reset to DATA1 by the UDPHS_EPTCLRSTAx register TOGGLESQ bit, and by UDPHS_EPTCTLDISx (disable endpoint).

Toggle Sequencing:

  • IN endpoint: Indicates the PID Data Toggle that will be used for the next packet sent. This is not relative to the current bank.
  • OUT endpoint: Set by hardware to indicate the PID data of the current bank:
ValueNameDescription
0 DATA0

DATA0

1 DATA1

DATA1

2 DATA2

Data2 (only for High Bandwidth Isochronous Endpoint)

3 MDATA

MData (only for High Bandwidth Isochronous Endpoint)