@MarkusL, so I see two possible areas where the Core can lock:
- sFlash due to SPI bus issues with CC3000 though I believe those were addressed in the firmware
- The ISR service time and the disabling of ALL interrupts for a long period of time is killing the background process or even the stack/heap.
My advice is:
a) Don’t use
__disable_irq(), and instead just disable/enable the timer interrupt with
interrupt_SIT(INT_DISABLE) / interrupt_SIT(INT_ENABLE). The timer runs at preemption level 10 above user interrupts but below critical system interrupts.
b) Don’t do floating point stuff in the ISR. It takes a lot of time and uses a lot of stack/heap.
c) Don’t call your math functions in the ISR. Put them inline instead.
From the looks of it, “waiting” in the ISR increments by 400us. You could use a 400us timer interrupt and, as mentioned above, convert your “for” loops to states in an FSM. The ISR would still do what it does but in short “bursts” doing the same thing, avoiding the 160ms no-interrupts approach.