Skip to main content
NDubr.1
Visitor II
Apr 10, 2020 9:47 AM UTC
Question

STM32CubeIDE generate wrong code in USB_HOST with FreeRTOS

File \USB_HOST\Target\usbh_conf.h has the definitions:

#define USBH_malloc     malloc

#define USBH_free      free

This does not work with FreeRTOS. It will be better, but maybe not perfect:

/** Alias for memory allocation. */
#if (USBH_USE_OS == 1)
#define USBH_malloc pvPortMalloc
#else
#define USBH_malloc malloc
#endif
 
/** Alias for memory release. */
#if (USBH_USE_OS == 1)
#define USBH_free vPortFree
#else
#define USBH_free free
#endif

This topic has been closed for replies.