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.

CCS: Insufficient memory when scanning

Tool/software: Code Composer Studio

Dear

    I open scanning in the code with interface GapScan_enable(0, 0, 0) after scan inited based on project multi_role,after hours later, the code will report insufficient memeory and stop the scan.so, what should i atttentin or somwhere shoudle be modified in the code?some related code as follow:

static void multi_role_scanInit(void)
{
  uint8_t temp8;
  uint16_t temp16;
  // Setup scanning
  // For more information, see the GAP section in the User's Guide:
  // software-dl.ti.com/.../
  // Register callback to process Scanner events
  GapScan_registerCb(multi_role_scanCB, NULL);
  // Set Scanner Event Mask
  GapScan_setEventMask(GAP_EVT_SCAN_ENABLED | GAP_EVT_SCAN_DISABLED |
                       GAP_EVT_ADV_REPORT);
  // Set Scan PHY parameters
  GapScan_setPhyParams(DEFAULT_SCAN_PHY, SCAN_TYPE_PASSIVE,
                       SCAN_PARAM_DFLT_INTERVAL, SCAN_PARAM_DFLT_WINDOW);
  // Set Advertising report fields to keep
  temp16 = MR_ADV_RPT_FIELDS;
  GapScan_setParam(SCAN_PARAM_RPT_FIELDS, &temp16);
  // Set Scanning Primary PHY
  temp8 = DEFAULT_SCAN_PHY;
  GapScan_setParam(SCAN_PARAM_PRIM_PHYS, &temp8);
  // Set LL Duplicate Filter
  temp8 = SCAN_FLT_DUP_ENABLE;
  GapScan_setParam(SCAN_PARAM_FLT_DUP, &temp8);
//  temp16 = SCAN_FLT_PDU_CONNECTABLE_ONLY | SCAN_FLT_PDU_COMPLETE_ONLY;
  temp16 = SCAN_FLT_PDU_ADV_ONLY | SCAN_FLT_PDU_SCANRSP_ONLY | SCAN_FLT_PDU_COMPLETE_ONLY;
  GapScan_setParam(SCAN_PARAM_FLT_PDU_TYPE, &temp16);
  multi_role_doDiscoverDevices(1);
  //BleCentralApp_init();
}
bool multi_role_doDiscoverDevices(uint8_t index)
{
  (void) index;
#if (DEFAULT_DEV_DISC_BY_SVC_UUID == TRUE)
  // Scanning for DEFAULT_SCAN_DURATION x 10 ms.
  // The stack does not need to record advertising reports
  // since the application will filter them by Service UUID and save.
  // Reset number of scan results to 0 before starting scan
  numScanRes = 0;
  GapScan_enable(0, 0, 0);
#else // !DEFAULT_DEV_DISC_BY_SVC_UUID
  // Scanning for DEFAULT_SCAN_DURATION x 10 ms.
  // Let the stack record the advertising reports as many as up to DEFAULT_MAX_SCAN_RES.
  GapScan_enable(0, DEFAULT_SCAN_DURATION, DEFAULT_MAX_SCAN_RES);
#endif // DEFAULT_DEV_DISC_BY_SVC_UUID
  // Enable only "Stop Discovering" and disable all others in the main menu
//  tbm_setItemStatus(&mrMenuMain, MR_ITEM_STOPDISC,
//                    (MR_ITEM_ALL & ~MR_ITEM_STOPDISC));
  return (true);
}