Skip to main content
Associate II
March 5, 2025
Solved

Issue with USB implementation with touchgfx

  • March 5, 2025
  • 1 reply
  • 457 views

 

I am using the STM32HUB50xBT6 development kit with TouchGFX. When enabling USB as Full-Speed (FS) and programming it with `USBH_PROCESS_STACK_SIZE` set to 4096, I face an issue where the allocation of `MSC_Handle` fails in the lower layers of the `usbh_msc` file. The debugging print message shows "cannot allocate memory for MSC handle," and this occurs within the `USBH_MSC_InterfaceInit()` function.

Can anyone help me in this

Thanking you in advance.

Best answer by naveen

this issue got solved, the problem is dynamic memory allocation when i peek inside a API of a driver there they are using malloc function to create a instant memory.

CORRECT ME IF IAM WRONG HERE: 
"what i learned from touchgfx, touchgfx will not support dymanic memory allocation it only supports static allocation. " correct me here please 

the same problem someone has faced. solution got explain by @Pavel A.  also iam pasting the link here for reference of their conversation " Concern on the usage of malloc() on USB Host MSC ... - STMicroelectronics Community "

thank your support!!

1 reply

naveenAuthorBest answer
Associate II
March 5, 2025

this issue got solved, the problem is dynamic memory allocation when i peek inside a API of a driver there they are using malloc function to create a instant memory.

CORRECT ME IF IAM WRONG HERE: 
"what i learned from touchgfx, touchgfx will not support dymanic memory allocation it only supports static allocation. " correct me here please 

the same problem someone has faced. solution got explain by @Pavel A.  also iam pasting the link here for reference of their conversation " Concern on the usage of malloc() on USB Host MSC ... - STMicroelectronics Community "

thank your support!!