I’ve created a diagnostics module that pretends to measure the amount of time that each task runs per second.
Therefore I’m using the macros:
This is the code of the …_IN macro (the …_OUT is very similar):
void Diagnostics_TASK_SWITCHED_IN ( pdTASK_HOOK_CODE pxTaskTag )
TickCount = xTaskGetTickCount();
when I use the code like this the system ends up in the __prefetch_handler, with very starnge values in the LR register.
If a comment the call to xTaskGetTickCount then all goes fine.
I’ve examined the function xTaskGetTickCount and it seems quite harmless.
I’ve tried to step into xTaskGetTickCount but it does not crash on the first 10 calls or so, it takes longer.
would there be any reason for this?