2023-02-09 12:11 AM
Project based on STM32F303 generated from CubeIDE 1.10.1 using HAL 1.11.3 library. The project was made according to the ST example. IN enpoint with a report of 64 bytes. OUT endpoint also with 64 byte report.
I can send any number of IN or OUT reports separately. Then everything works without problems.
But when I want to send reports back and forth, every time I send two IN reports, I stop receiving OUT reports. IN reports then continue to work correctly.
Only restarting the microcontroller helps.
I think there is a bug in the USB library.
Has anyone managed to solve this problem?
2023-02-13 01:43 AM
I found a solution to the problem.
There is a bug in the USB library for the F3 family. It has not been updated since 2019.
This error does not occur for the F1 family. I compared both libraries and found a problem in the interrupt handling in the file stm32fxxx_hal_pdc.c
On the left is the code for stm32f103 and on the right is for stm32f303. Just replace this part and the problem disappears.
2023-02-13 12:41 PM
Hello @Sławomir Kapelko and welcome to the Community :)
Thanks for sharing the issue and the solution.
I will check this and come back to you soon.
Imen
2023-02-21 01:08 AM
Hi @Sławomir Kapelko ,
You are using a quite old HAL for STM32F3. The fix was already published to allow multi packet sending. The fix was pushed in USB branch since June 2021, on top of that we also add another fix to allow multi packet sending.
When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.
Imen
2023-03-02 06:20 AM
Hi @Imen DAHMEN
I generated the project again from the new version from the STMCubeIDE software version 1.11.2 and the libraries STM32CubeF3 Firmware Package V1.11.3 /23-July-2021 and the problem still exists.
Why has the file stm32fxxx_hal_pdc.c not changed since the library has been corrected?
2023-03-11 12:30 PM