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.

Multirole application: Assertion fail in mb_patch.c: CMDSTA 0x86

Other Parts Discussed in Thread: CC2640

Hy there,

when trying to implement multirole feature in my CC2640 project (adding observer to a peripheral device) I see a crash of the application approx once in 48h. Crash means no more advertising, application stops. When debugging into a crashed device, I see an assertion fail in line 524 of mb_Patch.c

When reading out the CMDSTA register, I see 0x86 (SchedulingError)

What would be a proper reaction on this case? The current while(1) loop helps to debug the issue, but my device is not reactive any more. Is it possible to just ignore the issue and continue normal operation? Would a system reset be appropriate?

What might be the root cause of this issue? To my application: My device shall advertise (1 / s) and also listen to other advertisments (i.e. 2s every 10s).

For that reason, I added observer capabilities (gapRole_profileRole = GAP_PROFILE_PERIPHERAL | GAP_PROFILE_OBSERVER; and -DHOST_CONFIG=PERIPHERAL_CFG+OBSERVER_CFG )and use

        GAP_SetParamValue(TGAP_GEN_DISC_SCAN, discLength);
        GAP_SetParamValue(TGAP_LIM_DISC_SCAN, discLength);
to set the desired discovery time. With a timer I restart discovery with

        GAPObserverRole_StartDiscovery(DEVDISC_MODE_ALL, TRUE, FALSE);

Is that a good way to solve my application? Might that be the reason for my crashes?

Best regards

Harald

  • Hi Harlad,

    Just to confirm, are the above changes the only changes you made to the BLE 2.1 multirole demo? I would like to reproduce this internally and need the precise steps.

    Best wishes
  • Hy,

    no, it is actually not based on the multi role example but on the simple peripheral.

    I have a quite mature project that is about to be launched in series and in the next steps needs to be extended with multi role capabilities.

    So I kind of merged my project with the multi-role example, although I have not found an peripheral-observer project.

    > I would like to reproduce this internally

    I don't know, if I can send the code of the full project, I will clarify with my customer.Is it possible, to get in personal contact via PN or web session?

    In the meantime I try to describe what I did, starting from my modified simple peripheral project:

    - In stack project, file buildConfig.opt, define -DHOST_CONFIG=PERIPHERAL_CFG+OBSERVER_CFG

    - merge observer functions into peripheral.c to  file peripheralObserver.c

    - create a discovery restart timer that calls GAPObserverRole_StartDiscovery(DEVDISC_MODE_ALL, TRUE, FALSE); from the file above about every 6s

    - Whenever I see a new device during discovery I manage a list of all seen devices within function addDeviceInfo which I call in case GAP_DEVICE_INFO_EVENT within gapRole_processGAPMsg

    Again, what I actually want to do in this application:

    - During normal use act as a peripheral, that can be connected from a central (i.e. android device) and exchange data. During a special mode collect all visible devices and store some information about them to a list that can be retrieved by the central.

    Actually, at this moment, I have kind of a workaround: I only start discovery as a reaction of a Advertising end event (using HCI_EXT_AdvEventNoticeCmd). With this, I don't run into the SchedulingError issue any more, but approximately in the same time period (once a day) my device stops advertising. I monitor this with a timeout of advertising and as a reaction reset my whole device. For now, I can live with this workaround, because the field test will accept the little blackouts, but the final device need to do this properly.

    Any help appreciated, best regards

    Harald