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.

CC2642R: BLE Issues in FreeRTOS-Based Development with the CC2642

Part Number: CC2642R
Other Parts Discussed in Thread: SYSCONFIG

Hello TI Technical Support Engineers,
 
We are using the CC2642R chip configured as a BLE Central device. After integrating FreeRTOS into our project, we need to continuously acquire the RSSI of surrounding Bluetooth devices in a non‑connected manner.
 
However, after the program runs for a period of time, it can no longer enter the SC_EVT_ADV_REPORT branch inside the SimpleCentral_processAppMsg function. Eventually, it also fails to enter the SimpleCentral_scanCb callback. Debug breakpoints cannot be triggered in these two locations. The rest of the SimpleCentral_processAppMsg function still executes normally.
Our current BLE parameters are as follows: 
// Default PHY for scanning
#define DEFAULT_SCAN_PHY                        SCAN_PRIM_PHY_1M

//Default Scan type (Active/Passive)
#define DEFAULT_SCAN_TYPE                       SCAN_TYPE_PASSIVE

// Default scan interval (in 625 us ticks)
#define DEFAULT_SCAN_INTERVAL                   320

// Default scan window   (in 625 us ticks)
#define DEFAULT_SCAN_WINDOW                     160

// Default scan duration in 10 ms
#define DEFAULT_SCAN_DURATION                   100

// Advertising report fields to keep in the list
#define ADV_RPT_FIELDS                          (SCAN_ADVRPT_FLD_ADDRESS | SCAN_ADVRPT_FLD_ADDRTYPE)

// Scanner Duplicate Filter
#define SCANNER_DUPLICATE_FILTER                 SCAN_FLT_DUP_DISABLE

// TRUE to filter discovery results on desired service UUID
#define DEFAULT_DEV_DISC_BY_SVC_UUID            false
In addition, we only call the GapScan_enable(0, 0, 0); function at the end of the GAP_DEVICE_INIT_DONE_EVENT case inside the SimpleCentral_processGapMsg function, and the value of autoConnect is set to 0.
 
Could you please help analyze the root cause or provide some troubleshooting directions? Thank you very much.
 
Sincerely,
 
Deng Junjie

 

  • Hi,

    The BLE5Stack in the F2 SDK was developed and extensively tested on TIRTOS7, there may be unexpected behavior when migrating to FreeRTOS. I would recommend using TIRTOS7 if you base example is simple_central. That said, I would suggest takinga  look at how you are handling the events and how you have configured your SysConfig. I would check that SYS/BIOS is disabled as you have moved to freertos. I would also double check that you are using Event_pend() instead of xTaskNotify() or xQueueReceieve(). I would verify that you are handling your icall messages correctly via iCall_fetchMsg() and iCall_post(). I would also double check that you are still scanning after the connection is formed, its possible the scan is being disabled upon conneciton establishment and you need to reenabled if you are connecting.

    Best Regards,

    Jan