Part Number: CC2640R2F
Other Parts Discussed in Thread: LAUNCHXL-CC2640R2, SYSBIOS
Tool/software: TI-RTOS
Hi,
i'm using events module to post different button states from GPIO ISR Callback Fxn's to a predefined user main task. I've used GPIO.h library and interrupt are configured to occure on both edges.
I followed instructions from TI-RTOS Kernel User's Guide (SPRUEX3T) p. 115 and implemented runtime configuration.
For debounce logic I'm using Clock_module, which so far works very good. Parallel another clock instance for long push button action (5s push) is running.
All in all there are 3 button states:
#1: Falling edge --> Button wasn't pushed and is pushed now (after debounce time). An event for falling edge is posted and an initialisation routine is processed in my task.
#2: Short push --> Button was pushed and is released now. An event for short push is posted and a defined mode is processed.
#3: Long push --> Button still pushed after 5s clock instance overflow . An event for long push is posted and another defined mode is processed. post_Event is done in 5s clock overflow Callback Fxn.
Once #2 or #3 event was posted, events aren't allowed anymore (no disturbance allowed because of measurement of sensor data), so Event_delete(&myButtonHandle) is called.
In main user task another clock instance is used for waiting operations.
For safety and redundance resasons i tried to disable interrupts by using GPIO_disableInt(MYBUTTON), so that GPIO Callback Fxn should be never called. Unfortunately GPIO interrupt isn't disabled and Callback Fxn is called anyway. Therefore i declared a global status flag for disabling further GPIO interrupt handling.
After measurement is done peripherial devices are shutdown and events are reinitialised, so pending on events by using even_pend() is possible and allowed again at next loop iteration.
Now the problem is that the processor hangs up, when long push action #3 (only happens in this mode) was successfully processed and pending again on button events in next loop iteration.
When the button is pushed at this stage one of the following is happening,
-) Processor hangs up - disassambly:
-) IAR hungs up without error message
-) IAR hungs up with following error message:
I also tested our battery powered device "Standalone". Short push mode #1 is working fine, but once long push mode #3 occured cpu hangs up as well at next iteration.
What could cause the hang up of the CPU?
Further information:
simplelink_cc2640r2_sdk_1_40_00_45
IAR-Version: 8.11.2.13606
Debugger & Programmer: TI XDS110 from LAUNCHXL-CC2640R2 board
XDS Tools: xdctools_3_50_02_20_core