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.

CC2540: central mode scan only once work... and not working

Part Number: CC2540
Other Parts Discussed in Thread: BLE-STACK

hi,

for central+peripheral mode support device.(cc2540 -Mini-DK)

after reset and central mode start done, scan (GAPCentralRole_CancelDiscovery) called.

I received event GAP_DEVICE_INFO_EVENT, GAP_DEVICE_DISCOVERY_EVENT and scan again.

GAP_DEVICE_DISCOVERY_EVENT received, not find peripheral device. only one time working alright.

(BT_TOOL) for test USB dongle is well work done.

why only one time scan just work done. after scan not found peripheral device ?

  • Hi Jin,

    Can you help me to better understand your issue?

    1. What version of the TI BLE-Stack are you using?
    2. Did you start from the SimpleBLECentral project?
    3. What modifications did you make to the sample project?
    4. When you say "only one time working alright" does that mean that you try to scan multiple times but you don't receive any GAP_DEVICE_INFO_EVENTs any time but the first time? Or does it work every other time?
  • Hi Rachel,

    1.  BLE Stack Version 1.4.2.2

    2.  My base project BLE Bridge Patch Peripheral. add central mode ref. MasterSlaveSwitchV1_4

    3. Like MasterSlaveSwitch1_4 file modification section . Add my custom search Service and connect

    4. Scan1  -> GAP_DEVICE_INFO_EVENT -> timeout -> GAP_DEVICE_DISCOVERY_EVENT  ->

        Scan2 -> ---- -> timeout -> GAP_DEVICE_DISCOVERY_EVENT ->

        Scan3 -> ----- -> timeout -> GAP_DEVICE_DISCOVERY_EVENT ->

       ~~~9  -> ----- -> timeout -> GAP_DEVICE_DISCOVERY_EVENT ->

        Scan10 -> no answer

    number 4 my problem.. 

    I changed INT_HEAP_LEN size 1024 -> 2176 and  able to scan more times.

    Thanks & Best Regards,

    Jin

  • Hi Jin,

    It sounds like you may have run out of heap to store your scan results. Please follow the directions in the Heap Manager section (Section 3.3) of the CC254x Bluetooth low energy Software Developer's Guide v1.4.2 for guidance on how to profile your run-time memory usage.
  • the return value of the central callback function is 0. this return value is must TRUE(1)