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 using "GATT_Indication() " lead to the program exit

Other Parts Discussed in Thread: CC2541, CC2640

Dear All, I have the project that work well in CC2541. I port this project into CC2640. When the program call the GATT_Indication(), the program will exit, in IAR IDE 

I can see the it run here:

My code is as follow:

I debug the program found that the "GATT_Indication()" return value is FAILURE.

How could I to fix this? Is that I have missing some things?

Thanks!

  • Hi,

    In what RTOS context is your code running? Can you try disabling the LCD debug calls and see if it works?

    Best wishes
  • Hi JXS, thanks for your response.

    When the smart phone connects the CC2640, the indication description will be enabled, then my code will call the "pro_sendIndi()" to send the data to the smart phone, then the code is exit and the Bluetooth will disconnected.

    If I don't call the "pro_sendIndi()", the Bluetooth connection will OK.

    I try to remove the "TI_DRIVERS_LCD_INCLUDED" in the "Option->C/C++ Compiler->Preprocessor" to disable the LCD module,

    but it was the same result.

    Is there any more what can I do to solve this problem? TKS!
  • Hi,

    If you haven't already done so, please see the GlucoseSensor example, which uses indication in the function GlucoseSensor_ctlPntIndicate(..) -> Glucose_CtlPntIndicate(..). Perhaps you can find something you have missed, either in the init or in the use of indication.

    I'm not sure exactly what's wrong, but have you registered for indication? GATT_RegisterForInd(selfEntity); in the init section of your task function. Have you ensured that the length is sensible?

    Best regards,
    Aslak
  • Thanks Aslak,  I follow your idea resolve the problem, thank you.

  • Glad to hear it. Can you share with us what the problem and resolution was?

    BR,
    Aslak
  • I send the indication data immediately when the indication description is enable, this lead to the program exit.

    I change as follow:
    When the indication data is enable, start a timer to send the data, that is ok.