2021-09-27 11:40 AM
Hello.
I am using STM32H7, with USBD CDC HAL Driver.
I created a firmware that works as follows:
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
2021-09-28 06:54 AM
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.
2021-09-28 08:48 AM
@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:
-Piotr
2021-09-29 07:54 AM
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
2021-09-29 10:07 AM
I have updated STM32CubeH7 to version 1.9.0 but the problem still exists.
2021-10-03 03:40 AM
@Walid ZRELLI Any other advice?
2021-10-04 01:58 AM
Hello @Piotr Piórkowski
Can you check that your buffers are well aligned? This could be the cause of the problem.
BeST Regards,
Walid
2021-10-04 02:11 AM
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.
2021-10-04 02:37 AM
Hello @Piotr Piórkowski
Could you please provide your project for further check ?
Thanks in advance.
BeST Regards,
Walid