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: GapAdv_enable does not work occasionally

Part Number: CC2642R
Other Parts Discussed in Thread: SYSCONFIG

A customer has met a problem during production of CC2642R: occasionally the advertising is not enabled when it is  supposed to be. Please find the detailed issue as below.

There are 2 sets of advertisement enabled on the CC2642R. One has the interval of 33-35ms, the other has the interval of 20-21ms, both are legacy type on the 1M PHY.

GapAdv_params_t advParams1 = {
  .eventProps =   GAP_ADV_PROP_CONNECTABLE | GAP_ADV_PROP_LEGACY | GAP_ADV_PROP_SCANNABLE,
  .primIntMin =   52.8,
  .primIntMax =   56,
  .primChanMap =  GAP_ADV_CHAN_ALL,
  .peerAddrType = PEER_ADDRTYPE_PUBLIC_OR_PUBLIC_ID,
  .peerAddr =     { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa },
  .filterPolicy = GAP_ADV_WL_POLICY_ANY_REQ,
  .txPower =      GAP_ADV_TX_POWER_NO_PREFERENCE,
  .primPhy =      GAP_ADV_PRIM_PHY_1_MBPS,
  .secPhy =       GAP_ADV_SEC_PHY_1_MBPS,
  .sid =          0
};
GapAdv_params_t advParams2 = {
 .eventProps =   GAP_ADV_PROP_CONNECTABLE | GAP_ADV_PROP_LEGACY | GAP_ADV_PROP_SCANNABLE,
  .primIntMin =   32,
  .primIntMax =   33.6,
  .primChanMap =  GAP_ADV_CHAN_ALL,
  .peerAddrType = PEER_ADDRTYPE_PUBLIC_OR_PUBLIC_ID,
  .peerAddr =     { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa },
  .filterPolicy = GAP_ADV_WL_POLICY_ANY_REQ,
  .txPower =      GAP_ADV_TX_POWER_NO_PREFERENCE,
  .primPhy =      GAP_ADV_PRIM_PHY_1_MBPS,
  .secPhy =       GAP_ADV_SEC_PHY_1_MBPS,
  .sid =          0
};

The advertisements are disabled after establishing a connection, and are back on after a connection is terminated. The customer found that occasionally one of the advertisement is not enabled, and could recover after establishing and terminating a connection. It is random which advertisement is broken.

The issue was found on a couple of the devices out of thousands of devices being produced, and it is quite difficult to reproduce the behavior. So the customer would like to check under what circumstances the GapAdv_enable API could fail to cause this behavior. Please kindly provide some advice to debug this issue, thanks.

Best regards,

Shuyang

  • Hi Shuyang,

    I have assigned an expert to help with your query. In the meantime, can you provide the SDK version that the customer is using? If the customer is not no the latest SDK, can they verify if this behavior is observed on the latest release?

    Best Regards,

    Jan

  • Hi Jan,

    The SDK version is simplelink_cc13x2_26x2_sdk_4_10_00_78.

    The customer has not tried with the new SDK, is there any bug fixes in the new SDK related to this issue?

    BR,

    Shuyang

  • Hi shuyang,

    Also please provide the error code if it is possible. Please make sure you got a "FAIL" from the status of GapAdv_enable. Otherwise we need to look into other expressions.

    I also found something odd here. The primIntMin and primIntMax should be a unit32_t value in your struct, not 52.8 or 33.6. In fact, the value specified there is NOT the advertisement interval in milliseconds but in 0.625 ms units (e.g. if you expect an advertisement interval of 100 ms, you should set primIntMin and primIntMax to 160).

  • Hi Simon,

    I will ask the customer to provide the error code, but since this issue is tricky to reproduce, it may take time to catch the error code.

    Regarding to the primIntMin/primIntMax values, that is also what I want to discuss: actually these values are generated by Sysconfig. When a user inputs the Primary PHY Interval Minimum/Maximum which is in millisecond, the Sysconfig tool automatically converts the millisecond to the primIntMin and primIntMax value. When the Sysconfig inputs are not integral multiple of 0.625ms, the converted values will be a decimal number.

    I understand that the decimal numbers are not matching the uint32_t type, but it seems to work and there is no warrnings from Sysconfig or the compiler, so I'm not sure if the stack does some checking or it is just a coincedence. Could you please verify if this is an existing bug for Sysconfig? I also suggest to add some warning when user inputs are not integral mutiple of 0.625ms.

    Best regards,

    Shuyang

  • Hi Shuyang,

    The problem you mentioned is able to reproduce. I have reported that, let's wait for what comes up.