Other Parts Discussed in Thread: CC2642R, SYSCONFIG
Hi everyone,
I am working on simple central example, so basically we used 3 more GPIO pins with interrupt based. When we press key it will call SimpleCentral_keyChangeHandler(uint8 keys) function which will trigger the function SC_EVT_KEY_CHANGE in SimpleCentral_processAppMsg(scEvt_t *pMsg) ?(application fucntion) in this event key pressed are handled. So we are using 1 gpio for scanning (do discover), 2nd gpio for doGATTwrite function and 3rd also for doGATTwrite. I have attached the below image please have a look.
So basically my functionality of button are :-
1)GPIO BUTTON 1 - SCANNING by calling SimpleCentral_doDiscoverDevices
2)GPIO BUTTON 2 - GATTWRITE by calling SimpleCentral_doGattWrite(uint8_t index)
3)GPIO BUTTON 3 - GATTWRITE by calling SimpleCentral_doGattWrite(uint8_t index) with different index values. (i.e different data) sending using handle id.
# My queries are:
1)When I connect my hardware with cc2642r chip with launchpad in debugging mode all functionality of GPIO buttons are working are working fine but sometime it gets stuck in SimpleCentral_spin(void) which is a infinite loop, hence gets stuck. But how does it come to this function because because connIndex is 0 or 1 only so how does it comes here. It should not come.
2) When I flash my .hex file of simple_central in hardware with cc2642r chip none of GPIO button is working is not working I think its gets stuck somewhere in program (code) dont know why its happening I have used simple_central example code of TI. Is there any delay or this code goes in sleep mode and I need to wake up it. Please let me known how to do.
But I have notice one think when i take battery out and than connect again device is working sometime but sometime it doesnt work. None of GPIO button generates interrupt why it happening is it due clock or program get stuck somewhere please let me know and while debugging its gets stuck in SimpleCentral_spin function why this fuunction is used.
Does anyone have idea why it the program get stucks sometimes.
CCS - Version: 12.5.0.00007
TI launchpad - cc2642r
sdk version - 7_10_01_24
SIMPLECENTRAL_ASSERT(connIndex < MAX_NUM_BLE_CONNS);
#define SIMPLECENTRAL_ASSERT(expr) if (!(expr)) SimpleCentral_spin();