This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2640: Troubleshooting a problem with all tasks blocked

Part Number: CC2640
Other Parts Discussed in Thread: SYSBIOS

Our CC2640 BLE application has been up and running for some time, and we're ready to ship except that we occasionally get into a condition where things freeze and the only wait out is to cycle power by pulling batteries. Our (peripheral) app continuously streams simple messages over BLE at a rate of about 40/sec, and can stay up for quite some time before getting hit with the freeze.

I've spent much time with the CCS debugger and when we hang all our tasks show up as blocked, including ICall, so I'm wondering if the BLE stack is blocked for some unfortunate reason. CCS doesn't give me a good stack trace, so I can't see where the BLE stack might be waiting for. I tried following the frame pointer and it led to a region of RAM with all "20 20 20..." instructions, which didn't make sense to me.

I've also looked at stack sizes, the BIOS scan for errors, heap memory, Hwi, etc., and nothing jumps out at me as being problematic. I've tried disabling power saving, adding various asserts to check whether we're calling the BLE stack incorrectly, added error checking, etc., but nothing absolutely appears as troublesome. Looked at BIOS "Scan for errors..." and I get some messages "Error fetching Hwi stack info!", but the same message is there when things are running normally.

I tried setting BIOS.assertsEnabled, Task.initStackFlag, and Task.checkStackFlag, but can't do it since the RTOS is running in the PROM.

I'm starting to run out of ideas. Does anyone have any suggestions for troubleshooting this problem? Thanks!

  • Hello Hector,

    It's hard to tell what is happening for the description. The nominal behaviour of the ICall (protocol stack) task is Blocked since it will pend on an event/semaphore when there is no activity.

    What is the observed current consumption in this state? Can you run a periodic timer/event to confirm the RTOS is still active?

    Best wishes
  • Thanks JXS, will look at consumption and trying to set a periodic timer as you suggest.

    We originally thought that MCU was sleeping and not recovering properly, so we disabled power save by

    1) Setting PowerCC26XX_config.enablePolicy = FALSE
    2) Changing POWER_SAVING to xPOWER_SAVING for both the app and the stack

    Are these changes sufficient to prevent the micro from sleeping?

    Also, when we look at things through the CCS debugger, is there any way of telling that the micro is in a sleep state?

    Thanks again,

    Hector
  • JXS, I think it might be a clock/timer problem. When the freeze happens, the clock module shows the ticks field stuck. Generally the setup/config in our app should be correct since we can run for a while before hitting this freeze, so it must be a very timing-dependent bug. How would you suggest I could troubleshoot this problem? Thanks!
  • Still struggling with this. Any help/hints would be much appreciated.

    Here's what I have so far:
    - 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?

    Again, any thoughts would be much appreciated. Thanks!
  • Since I'm not getting too much traction on this forum, I'm closing this down, and moving to the TI-RTOS forum.