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.

Impossible to use Gatt_Notification() on cc2650 and program exit

Other Parts Discussed in Thread: CC2541, CC2640, CC2650

Hello,

I worked on a cc2541 before and i success to use GATT_Notification to send many bytes to my Android smartphone.

But, when i wan't to use the same function on cc2640/50, my program exit.

And always when i call "GATT_Notification" the program exit.

When i try to use setParameter on a characteristique 4 of simpleProfile it's same.. because setParameter use GATTServApp_ProcessCharCfg, this use gattServApp_SendNotiInd, and the last use GATT_NOTIFICATION.

//I wan't notify with new value
stat = SimpleProfile_SetParameter(SIMPLEPROFILE_CHAR4, len_notification, (void *) value);

When i debug, i have this :

static void loader_exit(void)
{
#if defined(EMBED_CIO_BP)
   __asm("         .global C$$EXITE");
#if defined(__32bis__)
   __asm("C$$EXITE:.word 0xDEFED0FE");
#else
   __asm("	 .align  4");
#if defined(__big_endian__)
   __asm("C$$EXITE:.half 0xDEFE");
#else
   __asm("C$$EXITE:.half 0xD0FE");
#endif /* __big_endian__ */
#endif /* __32bis__      */

#else  /* !EMBED_CIO_BP */
   __asm("        .global C$$EXIT");
   __asm("C$$EXIT: nop");
#endif
}

Someone have same problem ?

Best regards,

Steeve

  • Steeve,

    Did you check that the original application worked fine before doing modifications to it? On CC2640 you need to download the stack image separately.

    You should also check task stack usage (using the TI RTOS ROV viewer in CCS) as most of our example projects have minimized the stack to be just enough for the example.

    Regards,
    Svend
  • svendbt,

    I work with the SensortTag cc2650.

    After many test, i can tell you this :

    - In my simpleBLEPeripheral.c, i have SimpleBLEPeripheral_performPeriodicTask who copy the value of SIMPLEPROFILE_CHAR3 and notify this value into SIMPLEPROFILE_CHAR4.

    ==> SimpleProfile_SetParameter(SIMPLEPROFILE_CHAR4, SIMPLEPROFILE_CHAR4_LEN,valueToCopy) work on simpleBLEPeripheral.C, and my characteristic was notifiy.

    BUT, i wan't notify my characteristic from another task. I build a serial interface (like serialInterface in cc254x project).

    So, i have a npi_task.c check if theTransport Layer has received some bytes.

    And like HostTest project, i call NPIFrame_collectFrameData() , where i make my own frame parser.

    And this is on the file which implement NPIFrame_collectFrameData() where i try to notify my characteristic.

    For the beginning, just like this :

    uint8 valueToCopy[SIMPLEPROFILE_CHAR4_LEN] = { 0XCC, 0x28};
    SimpleProfile_SetParameter(SIMPLEPROFILE_CHAR4, SIMPLEPROFILE_CHAR4_LEN,valueToCopy);

    But, when i debug, i go in exit.C ... And the code is exactly the same in SimpleBLEPeripheral_performPeriodicTask, but he don't work here. Why ?

    Thank you.

    Best regards,

    Steeve

  • Do i need to add something on my npi_task for using Gatt_notification ?

    peripheral_task can but npi_task not. The problem is here.

    Thank you,

    Best regards

    Steeve

  • I have the same problem, have you found any solution?
  • No..
    My conclusion is : we can notify from task simplebleperipheral.c but not in npi_task...
    We need to find how use ICall framework i guess.

    If someone can confirm, and give us a way to follow it's will be greatfull :)
    Steeve
  • Firstly, note that the use of this command has greatly changed from the 1.4.0 release. In order to allow for fragmentation, you now need to allocate a buffer for each notification. This is described in detail, with an example, in section 5.3.5 of the software developer's guide included with the stack.

    You are correct that you can not send GATT Notifications from the NPI task as it does not register with ICall.
  • Also...the NPI task is only designed to handle NPI functionality. I would recommend setting an event in the application task which, when processed, will send a GATT Notification.
  • Hello Tim,

    I'll check section 5.3.5, and it show the code which are used when we call setParameter on the fourth characteristic of simpleProfile for exemple.

    So i'll tried to just use setParameter on this characteristic, but the issue is the same.

    What is the way to communicate between npi_task and application task ?
    Specially setting event.

    Thank you again.

    Best regards

    Steeve

  • I was suggesting that you use GATT_Notification and providing an example of where it was used correctly (setParameter).