Собственно проблема в следующем. При сохраннении контекста в прерывании от PIT таймера (на нём переключение между задачами висит в preemptive mode) происходит data abort.

При чём смотрю стек вызовов в arm-elf-gdb(Eclipse) вижу следующую картину
data abort
vPreemptiveTick
vPreemptiveTick
То есть либо vPreemptiveTick два раза вызывалось, либо глюк gdb.
Вообще очень непонятный случай. Как такое может быть? И как с этим бороться?
Код
void vPreemptiveTick( void ) __attribute__((naked));
void vPreemptiveTick( void )
{
/* Save the context of the current task. */
portSAVE_CONTEXT(); <----- происходит data abort
/* Increment the tick count - this may wake a task. */
vTaskIncrementTick();
/* Find the highest priority task that is ready to run. */
vTaskSwitchContext();
/* wdt firing verification */
halWdtHandler();
/* End the interrupt in the AIC. */
AT91C_BASE_AIC->AIC_EOICR = AT91C_BASE_PITC->PITC_PIVR;;
portRESTORE_CONTEXT();
}
void vPreemptiveTick( void )
{
/* Save the context of the current task. */
portSAVE_CONTEXT(); <----- происходит data abort
/* Increment the tick count - this may wake a task. */
vTaskIncrementTick();
/* Find the highest priority task that is ready to run. */
vTaskSwitchContext();
/* wdt firing verification */
halWdtHandler();
/* End the interrupt in the AIC. */
AT91C_BASE_AIC->AIC_EOICR = AT91C_BASE_PITC->PITC_PIVR;;
portRESTORE_CONTEXT();
}