USB NYET response despite of free buffer (LPC55S69 USB1 HS Controller)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

USB NYET response despite of free buffer (LPC55S69 USB1 HS Controller)

375 Views
pettel
Contributor II

I'm using EP2 OUT with double buffering.

  • Buf0 and Buf1 have 2048 bytes each
  • EP2 OUT is a bulk endpoint with a maximum packet size of 512 bytes

Both endpoints (EP2_OUT_BUF0, EP2_OUT_BUF1) are initialized with 2048 N-bytes and the endpoints are set to active.

Expectation: without further interaction 4096 bytes should be received, without a NYET response.

 

Observed behaviour: after Buf0 is full a NYET response is transmitted instead of an ACK response, despite Buf1 beeing completely empty and active.

Bild 2025-10-07 at 01.17.49.png

This behaviour is especially detrimental to performance if you work with 512 byte buffers for Buf0 and Buf1, because in this case a NYET response is transmitted after every OUT transmission from the host, which requires an unnecessary USB-Ping and reduces throughput.

Is there a workaround or is this a hardware bug?

  

Tags (2)
0 Kudos
Reply
2 Replies

282 Views
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @pettel,

This is by design of the USB stack implementation of the SDK. As you can see on a comment on "PERI_USBHSD.h": 

DATA_PENDING - As long as this bit is set to one and LPM supported bit is set to one, HW will
* return a NYET handshake on every LPM token it receives. If LPM supported bit is set to one and
* this bit is zero, HW will return an ACK handshake on every LPM token it receives. If SW has
* still data pending and LPM is supported, it must set this bit to 1.

 

0 Kudos
Reply

252 Views
pettel
Contributor II

Hi @EdwinHz ,

 

this topic is not about LPM tokens. It's about sending user data from the USB host to EP2 of the LPC55S69. Link Power Management and the associated transactions are a completely separate topic.

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2181199%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EUSB%20NYET%20response%20despite%20of%20free%20buffer%20(LPC55S69%20USB1%20HS%20Controller)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2181199%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI'm%20using%20EP2%20OUT%20with%20double%20buffering.%3C%2FP%3E%3CUL%3E%3CLI%3EBuf0%20and%20Buf1%20have%202048%20bytes%20each%3C%2FLI%3E%3CLI%3EEP2%20OUT%20is%20a%20bulk%20endpoint%20with%20a%20maximum%20packet%20size%20of%20512%20bytes%3C%2FLI%3E%3C%2FUL%3E%3CP%3EBoth%20endpoints%20(EP2_OUT_BUF0%2C%20EP2_OUT_BUF1)%20are%20initialized%20with%202048%20N-bytes%20and%20the%20endpoints%20are%20set%20to%20active.%3C%2FP%3E%3CP%3EExpectation%3A%20without%20further%20interaction%204096%20bytes%20should%20be%20received%2C%20without%20a%20NYET%20response.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EObserved%20behaviour%3A%20after%20Buf0%20is%20full%20a%20NYET%20response%20is%20transmitted%20instead%20of%20an%20ACK%20response%2C%20despite%20Buf1%20beeing%20completely%20empty%20and%20active.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Bild%202025-10-07%20at%2001.17.49.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Bild%202025-10-07%20at%2001.17.49.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F359753i9A2043D029B44F6A%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Bild%202025-10-07%20at%2001.17.49.png%22%20alt%3D%22Bild%202025-10-07%20at%2001.17.49.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThis%20behaviour%20is%20especially%20detrimental%20to%20performance%20if%20you%20work%20with%20512%20byte%20buffers%20for%20Buf0%20and%20Buf1%2C%20because%20in%20this%20case%20a%20NYET%20response%20is%20transmitted%20after%20every%20OUT%20transmission%20from%20the%20host%2C%20which%20requires%20an%20unnecessary%20USB-Ping%20and%20reduces%20throughput.%3C%2FP%3E%3CP%3EIs%20there%20a%20workaround%20or%20is%20this%20a%20hardware%20bug%3F%3CBR%20%2F%3E%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2187498%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20USB%20NYET%20response%20despite%20of%20free%20buffer%20(LPC55S69%20USB1%20HS%20Controller)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2187498%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F186731%22%20target%3D%22_blank%22%3E%40EdwinHz%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Ethis%20topic%20is%20not%20about%20LPM%20tokens.%20It's%20about%20sending%20user%20data%20from%20the%20USB%20host%20to%20EP2%20of%20the%20LPC55S69.%20Link%20Power%20Management%20and%20the%20associated%20transactions%20are%20a%20completely%20separate%20topic.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2186049%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20USB%20NYET%20response%20despite%20of%20free%20buffer%20(LPC55S69%20USB1%20HS%20Controller)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2186049%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F244769%22%20target%3D%22_blank%22%3E%40pettel%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EThis%20is%20by%20design%20of%20the%20USB%20stack%20implementation%20of%20the%20SDK.%20As%20you%20can%20see%20on%20a%20comment%20on%20%22PERI_USBHSD.h%22%3A%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3EDATA_PENDING%20-%20As%20long%20as%20this%20bit%20is%20set%20to%20one%20and%20LPM%20supported%20bit%20is%20set%20to%20one%2C%20HW%20will%3CBR%20%2F%3E*%20return%20a%20NYET%20handshake%20on%20every%20LPM%20token%20it%20receives.%20If%20LPM%20supported%20bit%20is%20set%20to%20one%20and%3CBR%20%2F%3E*%20this%20bit%20is%20zero%2C%20HW%20will%20return%20an%20ACK%20handshake%20on%20every%20LPM%20token%20it%20receives.%20If%20SW%20has%3CBR%20%2F%3E*%20still%20data%20pending%20and%20LPM%20is%20supported%2C%20it%20must%20set%20this%20bit%20to%201.%3C%2FPRE%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E