cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 sends USB NAK when data sent from host (PC)

Jonas_A
Associate II

Hi, 
I use STM32H7 with STCUBE 11.1.
I use RNDIS module  usbd_cdc_rndis.h to communicate with a PC.

Sometimes when the PC sends a frame the STM32 replies with NAK, here is the sequence that repeats:

SYNC
PID OUT
Address
CRC
EOP

SYNC
PID DATA0
data 30 bytes
CRC
EOP

SYNC
PID NAK
EOP

What might be the issue? Can I change the USB interval (CDC_RNDIS_FS_BINTERVAL)?


BR
Jonas



2 REPLIES 2
FBL
ST Employee

Hi @Jonas_A 

NAK is a normal USB handshake response that tells the host "I am not ready to receive data right now, please retry later." not necessarily an issue.
Would you specify the issue in application layer ? Do you use reference board? H735 DK? Do you reproduce using the example firmware? 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.




Best regards,
FBL

When this happens the PC resends the USB frame infinitely because the STM32 always sends NAK.
Do you know how to troubleshoot this? I use a j-link so I can set breakpoints etc.,  do you know which function that set the reply to NAK?
The attached .csv file is a log from the logic analyzer that I use.
The first packet that is responded with a NAK starts on line 112095 (byte: 0x40)