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.

CC2540 SimpleBLECentral using 128-bit UUID code build error

Other Parts Discussed in Thread: CC2540

First off I.E is terrible. I wrote a very detailed question and in trying to post a link I lost everything. I will try again.

I have a CC2540 EM dongle. I made a copy of the SimpleBLECentral folder which resides in C:\Texas Instruments\BLE-CC254x-1.4.1.43908a\Projects\ble\. I have travelled the forumsphere and learned that I have to add USE_128_BIT_UUID to the define symbol inside the IAR embedded workspace. Also I unchecked the overwrite default for Linker and Debugger and saved. I copied the simpleBLECentral.c which I got from the TI wiki (do search for 128-Bit UUID) and am using that c file in my project which was copied from forementioned activity. I rebuilt the code and observed all warnings were HAL_LCD.c related. I got 9 errors all related to the SimpleBLECentral.c file that is the new file.

I am using IAR EW version 9.20.2 under a trial license for 30 days. I have read around some people had other issues not necessarily my own but have gone to using 8.xx.x to help solve some problems. Any suggestions? All I want to do is have the firmware that allows for 128-bit UUID. Seems that should be readily available for download and test (wink, wink).

  • This is due to simpleBLECentralEventCB function prototype change. You can revise it back to "uint8 simpleBLECentralEventCB( gapCentralRoleEvent_t *pEvent )" and let simpleBLECentralEventCB to retrun TRUE in the end of function.

  • I tried your suggestion and it solved one of the errors (the first error listed for others who might be reading). Still the other 8 remain. I should have mentioned that I am not a C developer so I'm learning as I go.

    One thing that jumped out is this line in same file: attWriteReq_t req; 

    It is not defined anywhere in both the original SimpleBLECentral and the 128UUID version, yet when I compile the original  it compiles fine and I don't get this error:


    Error[Pe136]: struct "<unnamed>" has no field "value" C:\Texas Instruments\BLE-CC254x-1.4.1.43908a\Projects\ble\SimpleBLECentral_128UUID\Source\simpleBLECentral.c 447

    For the datalist errors do I need to find the struct its complaining about and somehow add those "properties" in?

    I did change this group of code inside the simpleBLEGATTDiscoveryEvent(gattMsgEvent_t *pMSg) from

    simpleBLESvcStartHdl = pMsg->msg.findByTypeValueRsp.handlesInfo[0].handle;

    simpleBLESvcEndHdl = pMsg->msg.findByTypeValueRsp.handlesInfo[0].grpEndHandle;

    to this (same as original) and that got rid of two more errors. So actually now I'm down to 6 errors.

    simpleBLESvcStartHdl = ATT_ATTR_HANDLE(pMsg->msg.findByTypeValueRsp.pHandlesInfo, 0);
    simpleBLESvcEndHdl = ATT_GRP_END_HANDLE(pMsg->msg.findByTypeValueRsp.pHandlesInfo, 0);

    Not sure is matching this to the original is a good idea since I'm not sure how much different the 128UUID version is from the original. I will do a diff compare of the two files and keep weeding through.

  • You have to change "value" on line 447 of simpleBLECentral.c to "pValue" since it is changed from old stack.
  • I resolved the last error for UUID_SIZE. It was declared with a different name (ATT_UUID_SIZE). I have no more errors regarding this issue, but is what I did for these

    simpleBLESvcStartHdl = ATT_ATTR_HANDLE(pMsg->msg.findByTypeValueRsp.pHandlesInfo, 0);
    simpleBLESvcEndHdl = ATT_GRP_END_HANDLE(pMsg->msg.findByTypeValueRsp.pHandlesInfo, 0);

    alright to do? If not I do whatever you suggest and post the results here for others to follow. But so far no errors. I will try to do a build and if I run into other issues make a new thread.
  • Yes, it's ok to do so to fix compile error.
  • One thing that jumped out is this line in same file: attWriteReq_t req; 

    It is not defined anywhere in both the original SimpleBLECentral and the 128UUID version, yet when I compile the original  it compiles fine and I don't get this error:

    -->you have to define it in simpleGATTprofile.h, which you did not copy to the project


    Error[Pe136]: struct "<unnamed>" has no field "value" C:\Texas Instruments\BLE-CC254x-1.4.1.43908a\Projects\ble\SimpleBLECentral_128UUID\Source\simpleBLECentral.c 447

    For the datalist errors do I need to find the struct its complaining about and somehow add those "properties" in?

    --> it's re-named, so instead of using req.value[0], you just need to change to req.pValue[0]

    For the rest, you just have to go thru the code and compare to see what makes sense. 

  • The project was what was shipped when I download Texas Instrument Bluetooth Stack and related tools. I'm essentially working in the shipped project folder so if simpleGATTprofile.h needs to be included I don't know where to put it. So far the changes I've made to the 128UUID central code at least cleared the errors I was getting earlier while leaving the attWriteReq_t req; line unchanged. Changing the req.value to req.pValue worked for me.