How to change USBH_malloc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2017-11-06 6: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-hal- Labels:
-
STM32Cube MCU Packages
-
USB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2017-12-18 7:40 AM
No one?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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?
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2017-12-20 2: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.
