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.

LAUNCHXL-CC26X2R1: simple_central example code stuck in between after flashing .hex file in hardware

Part Number: LAUNCHXL-CC26X2R1
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();

  • Hi,

    Thank you for reaching the support,

    If I understand correctly your question, the program crash in a SIMPLECENTRAL_ASSERT where connIndex is greater or equal than the MAX_NUM_BLE_CONNS, am I correct?

    Could you provide me with the following information:

    • What is the Max Number of Connections set in SysConfig ?
    • Can you locate where does the assert fails and what is the callstack in debug mode and when flashing (please refer to the Connect the debugger to a running target section in the debugging guide: Debugging — SimpleLinkTm CC13XX/CC26XX SDK BLE5-Stack User's Guide 2.02.09.00 documentation)
    • I see that you disabled the two-button menu, I would like to draw your attention that the global value scConnHandle should be valid before calling the doGatt commands.

    Regards

    Tanguy