Other Parts Discussed in Thread: SYSBIOS, CC2650, CC1350
Tool/software: TI-RTOS
We have a BLE application running TI-RTOS on the CC2640. It runs great, except that at some point things will freeze and the only way out is to power cycle by taking out the batteries.
I think I've narrowed down the problem to the RTC timer mysteriously stopping. Here's the info I've been able to gather, mostly from CCS register and POV views:
- I have two modes "good" and "bad". In good mode all is running perfectly, but at some point the CC2640 goes into bad mode, and freezes.
- In bad mode the CCS debugger shows that the ticks field in the clock module is stuck, doesn't move after pausing and resuming the debugger. In good mode, the ticks field goes up nicely as I pause/resume the debugger.
- In good mode I always see ISRPENDING 1 and VECTPENDING 010000 (16)
- in bad mode I always see ISRPENDING 1 and VECTPENDING 000000 (0)
- debugger also shows tickSource = ti.sysbios.knl.Clock.TickSource_TIMER
- I'm pretty sure we're using the AON_RTC (always on timer) at interrupt 20
- I don't think I'm using the builtin SysTick timer since the ENABLE bit in STCSR is set to 0 and STRVR and STCVR are are also zero.
- In good mode hwi shows all interrupts enabled, with our one pending interrupt 16
- In bad mode hwi shows all interrupts enabled, and none pending
- In bad mode we always see 1 or 2 IRPs pointing to ROM
- In good mode we seldom see IRPs pointing to ROM
- Hwi shows that all interrupts are running at the same priority, 255
- In both good and mode the timer at interrupt 20 appears as disabled in the Timer module
- We're using the AON_RTC (always on timer) at address 0x400092000
- In good mode the timer module shows the prevThreshold field moving along just fine
- In bad mode the timer module shows prevThreshold field stuck
Questions:
1) Why does the timer module show the state "disabled" in both good and bad modes? Is it because the debugger stops the clock?
2) What can cause the timer to become stuck?
3) Is it possible that we're getting too many stacked interrupts and we're breaking a stack or taking a bad return out of an ISR?
Any help would be much appreciated, thanks!
P.S. this is a dup of a question I posted in the BLE forum, but I think it's probably best discussed here. I'll close the other post, and sorry about cross-posting.