2017-11-06 06:59 AM
Hello,
I`m using the CubeMX 4.23 and want to use the HAL USB Driver. In the usbh:conf.h is the code:
/* Memory management macros */
&sharpdefine USBH_malloc malloc&sharpdefine USBH_free free&sharpdefine USBH_memset memset&sharpdefine USBH_memcpy memcpyBut i want to use the FreeRTOS functions for malloc and free. So i changed the code to:
/* Memory management macros */
&sharpdefine USBH_malloc pvPortMalloc&sharpdefine USBH_free vPortFree&sharpdefine USBH_memset memset&sharpdefine USBH_memcpy memcpyThis works fine, but as soon as i generate code with the CubeMX the change is gone. Is it possible to add something similar to the ffconf.h to the
usbh:conf.h or make it configurable in the CubeMX?
/* define the ff_malloc ff_free macros as standard malloc free */
&sharpif !defined(ff_malloc) && !defined(ff_free)&sharpinclude <stdlib.h>&sharpdefine ff_malloc malloc&sharpdefine ff_free free&sharpendifI hope you can help me with a solution
#usb-fs #cube #cube-hal2017-12-18 07:40 AM
No one?
2017-12-18 10:27 AM
,
,
Evidently...
Can't you find a USER section where you can add a ♯ undef/ ♯ define type construct?
How many times are you iterating through CubeMX? Can you sandbox the working code? Can you merge back in your changes?
2017-12-20 02:33 AM
Yes, i could find a
USER section where i can add a ♯ undef/ ♯ define type construct.
Because there is no USER section in the usbh_conf.h you would have to implement such an constrcut in the main.h, or somewhere else. But, IMHO i shouldn't need to, because the CubeMX should have a solution on board for this problem. The ♯ undef/ ♯ define type construct would work, but it would be fairly ugly and not as easy to maintain as an other solution. Like for example for the ff_conf.h.
I don't understand why the library doesn't have the ability to change the malloc defines.