You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The osTimerNew requires pvPortMalloc/pvPortFree, even with only static allocation is selected.
I migrated to CMSIS OS v2 because of explicit support in all the APIs for using static only memory allocation (i.e. owner module allocated memory resources at compile time).
It seems the osTimer API does not so easily allow for this on FreeRTOS as the internal timer construct provides no place to save the function pointer and argument in the Timer Control Block.
My solution was to statically allocate the additional space after the Timer Control Block, and simply pass in a larger cb and size. However, this CMSIS OS v2 FreeRTOS implementation needs to do some magic.
My implementation is a quick and dirty one, but could this idea be useful for you?
So the idea is that the owner statically allocate additional space for the Timer Control Block before calling osTimerNew(...)
Hi,
many thanks for your proposal! It is a very good idea to enable support when only static allocation is required. User application needs to provide a bit larger chunk of memory and therefore typedef StaticTimer_t cannot be used directly but I would say that this might be only a minor drawback.
Hi,
The osTimerNew requires pvPortMalloc/pvPortFree, even with only static allocation is selected.
I migrated to CMSIS OS v2 because of explicit support in all the APIs for using static only memory allocation (i.e. owner module allocated memory resources at compile time).
It seems the osTimer API does not so easily allow for this on FreeRTOS as the internal timer construct provides no place to save the function pointer and argument in the Timer Control Block.
My solution was to statically allocate the additional space after the Timer Control Block, and simply pass in a larger cb and size. However, this CMSIS OS v2 FreeRTOS implementation needs to do some magic.
My implementation is a quick and dirty one, but could this idea be useful for you?
So the idea is that the owner statically allocate additional space for the Timer Control Block before calling osTimerNew(...)
And then ...
The text was updated successfully, but these errors were encountered: