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.

Observer + Peripheral role using SensorTag 2 (CC2650STK)

Other Parts Discussed in Thread: CC2640, CC2650STK, CC2650, LAUNCHXL-CC2650

Hi,

I checked http://ti.com/ble-wiki and download CC2640_PeripheralObserverPatchV2_1.zip.

Then I tried to execute Observer + Peripheral function using CC2650STK,

but Observer function does not work at all while Peripheral function works good.

The error happens at following function which returns status=2(illegal parameter?!).

status = GAPObserverRole_StartDiscovery(DEFAULT_DISCOVERY_MODE, DEFAULT_DISCOVERY_ACTIVE_SCAN, DEFAULT_DISCOVERY_WHITE_LIST);

What I did is,

0. download SensorTag.hex file in ble_cc26xx_setupwin32_2_01_00_44423.exe to CC2650STK using Smart RF Programmer2. 

1. using SensorTag project, merge simpleBLEPeripheral.c to SensorTag.c and merge peripheralObserver.c to peripheral.c , mainly #ifdef PLUS_OBSERVER part. (As I couldn't do well changing board setting to CC2650STK by importing SimpleBLEPeripheralObserver project.)

2. change buildConfig.cfg with -DHOST_CONFIG=PERIPHERAL_CFG+OBSERVER_CFG 

3.  add define of PLUS_OBSERVER

4. build and download to CC2650STK

Could anyone tell me how to make it work with Observer + Peripheral using CC2650STK step by step?

(I have checked all posts here, but anyone does not show how to setup Observer(or Central) function with CC2650STK.)

Thanks

  • did you reassign the up key to one of the button on STK? The wiki page states "Press the UP key on the SmartRF06 board to start scanning"
  • Yes.
    I merge the source code of SimpleBLEPeripheral_handleKeys(uint8_t shift, uint8_t keys) in simpleBLEPeripheral.c
    to SensorTag_callback(PIN_Handle handle, PIN_Id pinId) in SensorTag.c.
    I also checked that key works correctly.But...GAPObserverRole_StartDiscovery() fails.

    Thanks,
  • The error code of 0x02 corresponds to INVALIDPARAMETER. Are you using the default parameters GAPObserverRole_StartDiscovery(). Also did you set up the GAP Observer params including GAPROLE_MAX_SCAN_RES in the initialization?
  • Yes, I use default parameters in simpleBLEPeripheral.c applying to my SensorTag.c.
    Also I setup completely same parameter in simpleBLEPeripheral.c like GAPROLE_MAX_SCAN_RES.

    It is very helpful for me and other people if someone create working Observer + Peripheral project for CC2650STK
    and put its source code somewhere like http://ti.com/ble-wiki.

    I add my files which is modified.

    SensorTag.mod.zip
    Thanks

  • Yes, we will try to add the SensorTag configuration. But it should be as simple as adding the board file for the SensorTag. You can look at Section 6.2 of the SDG for more info on board files: www.ti.com/.../swru393
  • Thank you for comment.
    I checked swru393 document at section 6.2.
    Currently it is difficult to use SimpleBLEPeripheralObserver project directly applied to CC2650STK platform
    because its libraries, device drivers, settings are completely different from CC2650STK.
    So I have no idea....maybe for most people who is not familiar to CCS...

    As I attached merged files for CC2650STK at previous post, it is very helpful if you could check them and tell me what is wrong
    or tell me detailed building steps using SimpleBLEPeripheralObserver project.

    Thanks,
  • Please ensure you build the stack project with the correct option for the HOST define. This can be found in the buildConfig.opt file in the TOOLS folder:

    /* BLE Host Build Configurations */

    /*-DHOST_CONFIG=PERIPHERAL_CFG

    /* -DHOST_CONFIG=CENTRAL_CFG */

    /* -DHOST_CONFIG=OBSERVER_CFG */

    /* -DHOST_CONFIG=BROADCASTER_CFG */

    -DHOST_CONFIG=PERIPHERAL_CFG+OBSERVER_CFG

  • Thank you for notification. But I have already set this.
    I think this Observer + Peripheral function is impossible with SensorTag2 platform because no one can provide actual working source code for a long time.
    If this is a limitation of SensorTag2 , TI should clearly declare. Otherwise, many people waste a lot of time....

    Thanks,
  • What is the version of the SensorTag HW do you have?

    Try the trainingTag project from SimpleLinkAcademy too

  • Thank you for suggestions.

    My SensorTag2 HW ver is 1.2.
    I checked SimpleLinkAcademy, but there was not Observer + Peripheral function related.

    Thanks,
  • You are right that there is no combo role project out of the box, but the TrainingTag project can be modified to support this.
    I have tested it, and it works.
  • I am having the same problem. Code Composer Studio Version: 6.1.3.00034
    project_zero_stack_cc2650
    project_zero_app_cc2650stk
    ble_sdk_2_02_00_31
    tirtos_cc13xx_cc26xx_2_18_00_03

    I think the compiler is the one recommended for the zero stack project / CCS which is 5.2.6 although it is nagging me to upgrade it to 5.2.7
    I do have 15.12.1 installed but it's not being used because the simple link academy examples don't seem to work at all with that compiler.

    Simply changing the build_config.opt in the stack project to have -DHOSTCONFIG=PERIPHERAL_CFG+OBSERVER_CFG with no other changes to the project causes it to not work at all.

    (please note - I am trying to write an observer / broadcast pair of tags and having absolutely no luck at all, third weekend in a row fighting the stupid thing where even the simplest change seems to render it inoperable).

    Changing the HOSTCONFIG back to just PERIPHERAL_CFG allows it to work.

    It's very hard to tell where exactly it's going wrong, but it seems like it never gets to the point where the task functions are called.

    It does, very helpfully, push out a kind of crossed out 0 to the serial log output (no, actually it's not helpful).

    I'm at the end of my tether and would rather take these two CC2650 simple link tags and their stupid little debugging boards and have the worlds smallest bonfire.
  • I take it all back. By following the suggestion further up the thread of starting with the simple peripheral example in the latest BLE stack (ble_sdk_2_02_00_31) I was able to port the observer example from the CC2650EM to the CC2650STK. I did have to add the CC2650STK buttons to the board_key.c file (amongst a heap of other things), but I am using the simple peripheral stack application with the build config changed to PERIPHERAL_CFG+OBSERVER_CFG.

    And it works like a champ.

    My advice is to set up the simple peripheral app and stack from the examples using the Ti Resource Explorer, get it compiled and running.

    Once you know it works, change the host config in the stack app and make no other changes. Compile and run it successfully.

    THEN, and only then, replace the Startup, Application and PROFILES virtual directories in the simple peripheral project and pile all the required sources into there. It's actually pretty easy once you get going. I used the project_zero app as a template for building a better board_keys.c file.

    You will also need to fiddle with the include directories to point them to your new directories.

    I'm using compiler 5.2.6 (will change this shortly), the build variant is CC2640F128.

    I take it back about the bonfire, I love this kit!
  • That is very good to hear.

    Another nice kit is also our CC2640 Launchpad -

    With this kit you can try the some other interesting examples from our gitHub:

  • And just to add, there is a Peripheral + Observer demo on the SimpleLink GitHub page for the LAUNCHXL-CC2650.

    Best wishes
  • Hi,
    is there a working example of the Peripheral + Observer demo for the CC2650STK board?
    Thanks.