Dummy StaticTimer_t size does not match Timer_t size
Market leading real time kernel for 40+ microcontroller architectures
Brought to you by:
gaurav-aws,
rtel
Do you have configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES set to a non zero
value? If so, please try it with
configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES set to 0 and report back. If
that fixes your issue then have a look at this post:
https://sourceforge.net/p/freertos/bugs/166/
Hi Richard.
Thanks for the quick response. I did see that other post before I submitted mine. Unfortuanatley, setting configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES to 0 doesn't resolve the issue. These static timer structures don't actually use the integrity check bytes.
It looks to me like the reason the reason StaticTimer_t doesn't match XTIMER is that XTIMER contains a callback function and StaticTimer_t does not:
TimerCallbackFunction_t pxCallbackFunction
Let me know what you think.
Nicole
List_t is used in the timer structure, hence
configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES makes a difference to the size
of the timer structure, but not the static timer structure.
The callback function is accounted for by the second position in the
pvDummy5[2] array.
Our tests do not show a discrepancy here - both structures appear to
have the same size, but not 26 bytes or 24 bytes, so we must be using
different ports. Can you please tell me which FreeRTOS port (chip) you
are using.
We are using the IAR MSP430X port.
I figured out the problem, though. I am using the MEDIUM data model and in that model a void pointer is 2 bytes, but the function pointer TimerCallbackFunctiont pxCallbackFunction is 4 bytes. So, that is why the two structures weren't equal.
I can switch to the Large model and both structures are equal and that fixes the issue. However, that is going to greatly increase the data size.
Is there a plan to port the Timers code for MSP430X, so the Medium model can be used?
That is good information. Can you please try replacing the definition
of StaticTimer_t with the following, and let me know if this now works
with both memory models:
Almost. It works with both memory models if you remove the pointer from pvDummy6. Like this:
typedef struct xSTATIC_TIMER
{
void pvDummy1;
StaticListItem_t xDummy2;
TickType_t xDummy3;
UBaseType_t uxDummy4;
void pvDummy5;
TaskFunction_t xDummy6;
#if( configUSE_TRACE_FACILITY == 1 )
UBaseType_t uxDummy7;
#endif
} StaticTimer_t;
Is this something we can expect in a future release?
I am not sure if there are other issues like this in other areas of Timers.c. I've only tried the Static Timers.
Thanks,
Nicole
Let me try formatting that again:
Ah - right yes - TaskFunction_t is already a pointer so the way I posted it it was a pointer to a pointer. That didn't show in my test as the function pointer and pointer to pointer were the same size.
Yes, if this works for you then I can check it in (with the pointer removed as per your post). Setting ticket to 'closed fix' with this solution.
Yes, sounds good. Do you know what release this might go into?