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.

Peripheral + Observer combo-role issue

Other Parts Discussed in Thread: CC2541, CC2541DK-MINI, CC2540

Hi,

Based on my previous assumption I tried to initialize the device in the role defined in the subject.

http://e2e.ti.com/support/low_power_rf/f/538/t/221578.aspx

At the GAPRole_Init:

gapRole_profileRole = 0x06; (Using the defined symbols caused the same)

When it didn't worked, I made some debug and finally found out that the GAP_DeviceInit does not return SUCCESS, but
INVALIDPARAMETER.

The most interesting is that it seems it doesn't make into the switch-case junction (at GAP_DeviceInit).

Could You please give some help concerning this? Maybe I didn't do something...

Any help will be appreciated! 

  • I made some changes in the gap.c (actually I excluded the switch-case junction), and the GAP_ParamsInit function responded SUCCESS.

    Everything seems working now, though i don't think it's the right way...

    What actually "HOST_CONFIG" is for?

    Can anyone explain me how could this happen?

    Best Regards,

    Andras

  • Hi Andras,

    I am also trying to make a peripheral-observer, a device that during a connection can still scan for other advertisements.

    and I also having the same problem

    when you say:

    Andras Balogh said:

    I made some changes in the gap.c (actually I excluded the switch-case junction), and the GAP_ParamsInit function responded SUCCESS.

    Everything seems working now, though i don't think it's the right way...

    everything seems working as expected??

    and secondly how did you exclude the switch-case junction, automatically setting SUCCESS for all the conditions?

    Kind Regards,

    LUIS

  • Hi Luis,

    Nope, the observing function had not worked for me.

    What was interesting that it worked with btool, when the usb module was set in central mode. I received (almost) every packet.
    But when I did the same with Peripheral-Observer combination on the keyfob it just simply did not set the corresponding event, when an advertisement was sent from the other keyfob (?why?). Everything else (regarding the peripheral functions) worked fine...

    Luis Espinales Delgado said:

    and secondly how did you exclude the switch-case junction, automatically setting SUCCESS for all the conditions?

    No I just changed the statement at the start of gapDeviceInit:

    bStatus_t stat = SUCCESS;//INVALIDPARAMETER;

    Sorry I can not help more...

  • Hi Andras, thanks for your answer. I don't know if you are still working on it since your first post is a bit old now but I have found the way to get the "stat = SUCCESS" propperly. It was indeed related to the HOST_CONFIG parameter.

    In the workspace of IAR.. go inside the "TOOLS" folder-> open the "buildConfig.cfg" file and modify the BLE Host Build Configuration, make comment (add two slash "//" )  the observer config and uncomment the peripheral+observer one. Leave everything else in that file the same. Should look like this in the end:

    //-DHOST_CONFIG=PERIPHERAL_CFG

    -DHOST_CONFIG=PERIPHERAL_CFG+OBSERVER_CFG 

    Now, it is running properly on my chip. It is indeed doing the observer and peripheral functions. 

     I think this is the answer for the initial question of the post, so please verify it so it can help others. 

    Best regards
    Luis 

  • Thank You very much, for the answer.
    The project is now a bit out of scope, but I hope, I can return to it soon. 

  • Hi guys,

    Im facing the same issue now. I would like to enable passive scanning (observer) in peripheral device. I change that

    gapRole_profileRole

    value and also

    -DHOST_CONFIG=PERIPHERAL_CFG+OBSERVER_CFG

    in config file. But I still have this error after compiling:

    Error[e46]: Undefined external "GAP_CentDevMgrInit::?relay" referred in gap ( C:\Texas Instruments\BLE-CC254x-1.3.1\Projects\ble\KeyFob\CC2540DB\CC2540DK-mini Keyfob Slave\Obj\gap.r51 )

    I cannot move to adding the scanning function then. Can I ask how did you manage this configuration? Am I still missing some other things?

    Thanks for help. Will be really appreciated.

    Ondrej

  • Hi,

    Is this thread about the combined peripheral+observer role on a CC2541 ? Which devices are you using?

    I also just started looking at the possibility of using peripheral+observer on the CC2541DK-MINI. There is a library called CC2541_BLE_peri_observ.lib that comes as part of the platform which got me thinking.

    I wonder how the stack needs to be configured to make a CC2541 Key Fob to work as a peripheral/Observer. I did not come across any macro switches for the Peripheral/Observer role which makes me suspect that this role is not supported. I am using TI BLE stack version 1.3.2 by the way.

    Any feedback on this feature will be greatly appreciated.

    Regards...

  • Hi again,

    I have just found out the following commented out line in buildConfig.cfg file under TOOLS.

    //-DHOST_CONFIG=PERIPHERAL_CFG+OBSERVER_CFG

    I think all I need to do is to comment this in (and comment out the -DHOST_CONFIG=PERIPHERAL_CFG line just above it) to start using the peripheral+observer role.

    (all comments still welcomed :) )

    Regards...

  • Hi,

    Im using the CC2540 but I dont think that makes difference.

    Anyway the line you found is important. It is explained in the beginning of this topic. The next part you also have to change is in peripheral.c:

    // Initialize the Profile Advertising and Connection Parameters
    gapRole_profileRole = GAP_PROFILE_PERIPHERAL;

    So change that for example to: GAP_PROFILE_PERIPHERAL | GAP_PROFILE_OBSERVER

    But even when I did this I still had some errors. And since it is not priority now I left the problem. Maybe I will return again to it in the future. So good luck. If you find some interesting solution it would be cool to post it :)

    Ondrej

    EDIT: But even setting the correct configuration is just the beginning. Than it is needed to implement all the observing functions. I think the best way to do is to copy from Observer example in TI BLE Project folder. I even didnt get to it cause I did not overcome problems with config.

  • Ondrej Lufinka said:
    Anyway the line you found is important. It is explained in the beginning of this topic. The next part you also have to change is in peripheral.c:

    // Initialize the Profile Advertising and Connection Parameters
    gapRole_profileRole = GAP_PROFILE_PERIPHERAL;

    So change that for example to: GAP_PROFILE_PERIPHERAL | GAP_PROFILE_OBSERVER

    This concatenation is a good tip. I will keep that in mind. Thanks.

    Ondrej Lufinka said:
    EDIT: But even setting the correct configuration is just the beginning. Than it is needed to implement all the observing functions. I think the best way to do is to copy from Observer example in TI BLE Project folder. I even didnt get to it cause I did not overcome problems with config.

    Yes, I agree. It will make sense to cut and paste to start with. Once the features are working as expected, the analysis will be easier.

    Regards...

  • Ondrej Lufinka said:
    But even when I did this I still had some errors. And since it is not priority now I left the problem. Maybe I will return again to it in the future. So good luck. If you find some interesting solution it would be cool to post it :)

    Is anyone succeeded in solve this problem?

    I want to make PERIPHERAL + CENTRAL device.

    I set: 

    gapRole_profileRole = (GAP_PROFILE_CENTRAL | GAP_PROFILE_BROADCASTER)

    and 

    -DHOST_CONFIG=PERIPHERAL_CFG+CENTRAL_CFG in buildConfig.cfg file.

    And I still have errors:

    Error[e46]: Undefined external "GAP_EstablishLinkReq::?relay" referred in central ( C:\Texas Instruments\BLE-CC254x-1.3.2\Projects\ble\SimpleBLEPeripheral\CC2540DB\CC2540DK-MINI Keyfob\Obj\central.r51 ) 

    Error[e46]: Undefined external "GAP_CentDevMgrInit::?relay" referred in gap ( C:\Texas Instruments\BLE-CC254x-1.3.2\Projects\ble\ SimpleBLEPeripheral\CC2540DB\CC2540DK-MINI Keyfob\Obj\gap.r51 )
    Error[e46]: Undefined external "GAP_CentConnRegister::?relay" referred in gap ( C:\Texas Instruments\BLE-CC254x-1.3.2\Projects\ble\SimpleBLEPeripheral\CC2540DB\CC2540DK-MINI Keyfob\Obj\gap.r51 )
    Error[e46]: Undefined external "SM_InitiatorInit::?relay" referred in gap ( C:\Texas Instruments\BLE-CC254x-1.3.2\Projects\ble\SimpleBLEPeripheral\ CC2540DB\CC2540DK-MINI Keyfob\Obj\gap.r51 )
    Error while running Linker

    Any advice please :)

    My program looks almost identical to MasterSlaveSwitch sample.

  • I have the same error too.

    Error[e46]: Undefined external "GAP_CentDevMgrInit::?relay" referred in gap ( C:\Texas Instruments\BLE-CC254x-1.3.2\Projects\ble\KeyFob\CC2541DB\CC2541DK-mini Keyfob Slave\Obj\gap.r51 )

    Error[e46]: Undefined external "GAP_CentConnRegister::?relay" referred in gap ( C:\Texas Instruments\BLE-CC254x-1.3.2\Projects\ble\KeyFob\CC2541DB\CC2541DK-mini Keyfob Slave\Obj\gap.r51 )

    Error[e46]: Undefined external "SM_InitiatorInit::?relay" referred in gap ( C:\Texas Instruments\BLE-CC254x-1.3.2\Projects\ble\KeyFob\CC2541DB\CC2541DK-mini Keyfob Slave\Obj\gap.r51 )

    How to solve it??

  • Have you solved this problem? I have the same error.

    Thanks!

  • I'm using the sensortag project. I wanted the sensortag to have combo roles: Peripheral + Observer.

    I merged the combo role profile peripheralObserverProfile.c and peripheralObserverProfile.h that TI provided(File:SimpleBleCombo.zip) into the sensortag project. Lots and lots of callback functions and initialization to set. Huge work!

    What I did is listed below:

    1. Exclude "peripheral.c" and "peripheral.h" from the "PROFILES" folder on the build tree. Add new file "peripheralObserverProfile.c" and "peripheralObserverProfile.h" to the "PROFILES".

    2. change the file "buildConfig.cfg", just like everyone was discussing earlier

    //-DHOST_CONFIG=PERIPHERAL_CFG

    -DHOST_CONFIG=PERIPHERAL_CFG+OBSERVER_CFG

    3. on the project tree, in the "LIB" folder, exclude "CC2541_BLE_peri.lib", and add new file "CC2541_BLE_peri_observ.lib" which is located in "CC254x-1.4.0/Projects/ble/Libraries/CC2541DB/bin/". And, the error ("Error[e46]: Undefined external "GAP_CentDevMgrInit::?relay" referred in") goes away.

    4. lots and lots of callback functions(such as "peripheralStateNotificationCB", "observerEventCB")and initialization depending on different applications (a huge work)

    and I have everything sorted out without any error.

    What I didn't do is what everyone is talking about gapRole_profileRole = (GAP_PROFILE_CENTRAL | GAP_PROFILE_BROADCASTER)

    I hope this helps. Good luck everyone

  • patch for File:SimpleBleCombo.zip

    http://e2e.ti.com/support/wireless_connectivity/f/538/t/346265.aspx

  • I noticed a lot of people in this thread specified that they are using TI BLE Stack 1.3.

    Are the ComboRoles applicable for the TI BLE Stack 1.4 yet? Has anybody done it, or am I better off switching to 1.3 in order to accomplish this?

    Thanks,

    Peyton

  • I managed to fix these errors, the problem is that those functions are never implemented because the wrong library is included. So after changing
    -DHOST_CONFIG=PERIPHERAL_CFG+CENTRAL_CFG in buildConfig.cfg file
    gapRole_profileRole = (GAP_PROFILE_CENTRAL | GAP_PROFILE_BROADCASTER)

    Go to the LIB folder and exclude CC2540_BLE_peri.lib, then include CC2540_BLE.lib. That should remove the errors like "Error[e46]: Undefined external "GAP_CentDevMgrInit::?relay" referred in gap ( C:\Texas Instruments\BLE-CC254x-1.3.2\Projects\ble\ SimpleBLEPeripheral\CC2540DB\CC2540DK-MINI Keyfob\Obj\gap.r51 ) "

    Also I'm running on stack 1.4
  • Hello all. Have you taken a look at the combo Roles wiki page? It includes a peripheral+observer example.

    processors.wiki.ti.com/.../SimpleBLE_ComboRoles

    Note that this is for the 1.4.0 stack.