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.

CC2541: Sony Xperia, Android 7.0 cannot connect after stackupdate from 1.4.0 to 1.4.2.2

Part Number: CC2541


For a CC2541 based ble peripheral we have updated the BLE stack from 1.4.0 to 1.4.2.2. To ease the update process for the end user, we have decided to retain the bonding information by setting the OAD_KEEP_NV_PAGES compiler directive as described in the SBL wiki. 

While this configuration has worked with all tested phones without any problems, we face problems when trying to connect with Sony Xperia after Update to Android 7.0. A connection is not possible any more. 

A little analysis shows, that if we completely erase the flash and reprogram the chip (this means that the SNV area gets reinitialized by the stack), everything works fine.

We have the impression that there are invalid or undefined SNV items for the new stack (that get utilized when connecting with Xperia/Android 7.0).

Please note, we are talking about the SNV items reserved for the stack only (SNV ids <= BLE_NVID_GATT_CFG_END).

Can the stack version 1.4.2.2 work proprely with a booted SNV area of stack version 1.4.0 under all conditions? Is the full compatibility given?

  • Hello Daniel,

    Out of curiosity, did you apply the suggested findItem fix from the pinned "CC254x with Android 6.x Marshmallow & 7.x [Updated Oct 2016]" post? This patch has a performance improvement to SNV.

    Best wishes

  • Hello JXS

    Thank you for your information. We haven't yet applied this patch, but we are going to do so. As soon he have results, we will put a statement here.

    Thank you
  • Hello JXS 

    After one week testing, we did not see any blocking situations when connecting from Sony Xperia. Obviously the patch solves the problem. If I interpret it correctly, the patch adds a critical section when accessing the NV data. This gets relevant, when connecting with a Sony Xperia and Android 7.0.

    Due to the fact, that my first question regarding SNV compatibilty over different stackversion has not been answered, I assume that for the version 1.4.2.2 the full compatibility of a SNV image booted with 1.4.0 is given. (You might want to acknowledge this.)

    Thank you for your support.

    BR Daniel

  • Hello Daniel,

    Thank you for confirming the patch is successful with your Sony phone running Android 7.

    Regarding SNV compatibility, there is no change to osal_snv.c between BLE 1.4.0 and unmodified BLE 1.4.2.2 or to the way the protocols stack stores pairing records to SNV. All of this code is provided in source so you are able to confirm likewise. Of course, I do recommend you test your application configuration as well.

    Best wishes