cancel
Showing results for 
Search instead for 
Did you mean: 

USB CUSTOM HID library - very long response delay - STM32F303CB

keebler
Associate

Hi,

I am new to STM32CubeIDE but I decided to move some projects to brand new IDE, refresh them in the terms of used libraries etc.

Initial version was prepared in AC6 SW4STM32 and was using FreeRTOS v9 and USB CUSTOM HID library that was generated by AC6, lets call it v1.

I have generated new project in STM32CubeIDE, defined peripherals via CubeMX, added FreeRTOS (with CMSIS wrapper) and of course USB library (lets call it v2). It took some effort to glue all that new code with "old flesh" but I succeed and everything seems to work stable (excluding debugging initialization which very often refuses to start because is unable to stop the core - I have to erase chip in Utility and then it can flash it without problems..).

The problem is that response of USB CUSTOM HID library is delayed. With GPIO I monitor execution of request being pushed from library to task queue (callback function that passes handler to 64B report buffer) and then with another GPIO the task execution - taking element from queue, preparing response and sending it to host.

From that point of view it looks OK - response sending occurs in less than 1ms (bInterval is set to 1ms in descriptor) after request.

But from HOST application point of view WRITE operation takes about 30ms and then READ takes another 30ms.

To make long story short - after all I have removed that new "v2" library generated by STM32CubeIDE and copied old files of library "v1" from AC6 - INCREDIBLE BOOST in performance. With old library HOST application reports <1ms for WRITE and <1ms for READ operations.

So what is wrong with this new library? Other code left totally unchanged.

During "glueing" code, copying descriptors with DiffMerge etc. I have seen that in many places something was changed, like added real return statuses instead of always returning "USBD_OK" etc. but something went really wrong out there...

Does anybody else experienced such problems with these refreshed libraries? And maybe someone solved the problem?

0 REPLIES 0