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.

RTOS/CC2640: Memory allocation issue after long-time scanning.

Part Number: CC2640


Tool/software: TI-RTOS

When using 2640 with BLE stack 2.2.1, after hours of passive scanning, we found that HEAPMGR_MEMALO keeps unchanged, but HEAPMGR_MEMMAX and  HEAPMGR_MEMUB keep increasing until they reach to HEAPMGR_SIZE. That will lead to a crash of the stack.  

From MemAlo's value, we can see that we still have enough memory and all the allocated memory are released. But MemUB's value keeps increasing, regardless of the size of HeapSize.

Can anyone shed some light on this?

Thanks in advance.

  • Hi Vincent,

    Could you give us details on which example application you are using? (simple_central? simple_observer?)

    And did you end up making any modifications to the example prior to hours of passive scanning?

    IAR or CCS, and your development platform (launchpad or em)?

    Give us any other details you believe is relevant such that we may reproduce the issue on our side.

    Regards,
    Rebel
  • @A.Rebel,

    We use host_test project.

    When we use continuous  scan, we noticed that 

    HEAPMGR_MEMMAX   and HEAPMGR_MEMUB keep increasing until the stack crashes.

    We are using IAR.

    Here's a piece of our code: after we started scanning, the discovery event was sent over:

    case GAP_DEVICE_DISCOVERY_EVENT:

          {

            gapDevDiscEvent_t *pPkt = (gapDevDiscEvent_t *)pMsg;

    #ifdef DISC_REPEAT_ENABLE

            if ( (pPkt->hdr.status == SUCCESS) && (g_repeat_scanning != REPEAT_SCANNING_NONE))

            {//repeat scan

              GAP_DeviceDiscoveryRequest( &discReq );       

            }