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.

CC2340R5: Observer + Peripheral functionality

Part Number: CC2340R5
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Dear Team,


I am implementing observer functionality in my project using the CC2340R5 module as a peripheral with SDK 8.40.
In SysConfig, I know I can change the role to Peripheral + Observer, but due to the structure of my code, I want to manually
include app_observer.c in my project.

Upon testing, I found that the Observer_start() function does not return SUCCESS and instead gives a bleIncorrectMode error,
indicating that BLE is not set up properly to perform the requested task. I suspected that this might be due to the inability
to run advertising and scanning simultaneously, so I attempted to stop advertising before starting scanning. However,
I still received the same error.

I would appreciate any support in resolving this issue at the earliest. Additionally, if there is any relevant documentation
on this topic, please share it.

void App_StackInitDoneHandler(gapDeviceInitDoneEvent_t *deviceInitDoneData)
{
    bStatus_t status = SUCCESS;
    //DevInfo_start();
    Observer_start();
    vfn_BCPT_Init();
    s_DSM_Init();
    Peripheral_start();
    Connection_start();
    Pairing_start();
    Data_start();
}

Regards,

Shivam

  • Hello Shivam,

    Thanks for reaching out. We will look into your issue as soon as possible. I understand that you want to add this functionality manually, but it could be a good reference to see what are the changes that take place when selecting Peripheral + Observer using SysConfig. You can see the generated files (modified elements) as well.

    BR,

    David.

  • Hi David,

    The above suggestion resolved my issue with the Observer_start() function. I need to confirm whether the BLE stack can run scanning and advertising simultaneously. Could you please confirm?

    Regards,

    Shivam

  • Hello Shivam,

    The BLE stack cannot scan and advertise at the exact same time, however the scheduler of the BLE stack will be able to schedule the scanning and advertising accordingly.

    Best Regards,

    Tarek

  • Hi Team, 

    I'm currently running the SDK 8.40 data_stream example on the CC2340R5. The device is set as an observer to receive data packets from TPMS sensors. While the device is scanning, it isn't receiving any packets from the TPMS. The TPMS devices are advertising packets, so the issue doesn't seem to be on their end. In the terminal, I can only see the message 'MenuModule_printf(APP_MENU_SCAN_EVENT, 0, "Scan status: Scan started...");' but no packets are being received. Could someone please look into this issue? Below is the configuration:

    Thanks,

    Shivam

  • Hello Shivam,

    I'm looking into this and will get back to you by end of day on Monday (March 3rd).

    Could you in the mean time provide the parameters you are using for your broadcaster?

    Regards,

    Tarek

  • Hi Tarek,

    below are the advertising parameters of broadcaster(TPMS):

    Advertising Interval:
    When pressure ≠ 0 → Every 50 sec (broadcasting LE frame)
    When pressure = 0 → Every 100 sec (broadcasting LE frame)
    Fast Update Mode (pressure change ≥ 3 PSI) → Every 1 sec

    Broadcasting Count:
    3 packets per advertising event

    Broadcasting Delay:
    1 sec delay between packets

    Regards,

    Shivam

  • Hello Shivam,

    Thank you for your patience! I tested the settings you provided on my end and I was able to see data when I started scanning (unable to recreate the problem). Please make sure you are editing the code of the observer to have it print the scan results. Our Scanning and Advertising Basics trainings shows you how to edit the scanner to do this. I would also suggest testing this with 2 launchpads, one as a broadcaster and one as an observer, to make sure the issue is not with the TPMS sensors.

    I hope this helps!

    Best Regards,

    Tarek