cancel
Showing results for 
Search instead for 
Did you mean: 

USB HS after the first BULK transfer is complete, does not receive next

PPiór.1
Associate III

Hello.

I am using STM32H7, with USBD CDC HAL Driver.

I created a firmware that works as follows:

0693W00000FAZhtQAH.png 

The first one I got from the PC, via USB, JPEG , then I decode it to YUV, then using DMA2D to RGB and then display it using LTDC. Everything works great for one frame.

The problem is next frame . I can't get it anymore.From what I can see in wireshark, for the first URB BULK request I get URB BULK response with code 0 (success), but for the next one it is already code 71 (EPORTO).

In my receive callback, after each packet received, it increments the address for the new packet, and at the end of the transfer it swap the buffers. Every time I call USBD_CDC_ReceivePacket.

When I disconnect all non-USB functionality, the problem does not occur.

Additionally, I noticed that in case of a problem, I get USB reset and USB suspend interrupts after receiving the first packet (in the second case, when everything is fine, I don't get any additional interrupts)

I've been debugging the problem all day and can't figure out what's causing it

8 REPLIES 8
Amel NASRI
ST Employee

Hi @Piotr Piórkowski​ ,

What do you mean by "When I disconnect all non-USB functionality, the problem does not occur."?

Could you please share some more details (Ex: exact HW, used firmware ...) so that our experts can help you?

@Walid ZRELLI​  can have a look then.

-Amel

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.

PPiór.1
Associate III

@Amel NASRI​ 

> What do you mean by "When I disconnect all non-USB functionality, the problem does not occur."?

I was speaking in the context of my program: Disconnecting all non usb funcionality means stopping the processing of data coming from the USB by other hardware components such as JPEG decode, MDMA and DMA2D - (Take a look at the diagram I posted) .

As for hardware and firmware details:

  • hw STM32H743BTT6
  • HAL in version 1.8.0 (generated by STM32CubeMX 6.1.2)
  • External USB PHY USB3300

-Piotr

Hello @Piotr Piórkowski​ ,

Could you please try using the STM32CubeH7 V1.9.0 and let me know if you are still facing the same problem?

Thanks in advance.

BeST Regards,

Walid

PPiór.1
Associate III

I have updated STM32CubeH7 to version 1.9.0 but the problem still exists.

@Walid ZRELLI​  Any other advice?

Hello @Piotr Piórkowski​ 

Can you check that your buffers are well aligned? This could be the cause of the problem.

BeST Regards,

Walid

Hello @Walid ZRELLI​ 

I thought about it, but notice that when I turn off the processing of data received from USB everything works fine, and the size of buffers or the amount of data sent over USB does not change.

Hello @Piotr Piórkowski​ 

Could you please provide your project for further check ?

Thanks in advance.

BeST Regards,

Walid