I will reopen a topic that was already asked here Re: OTA Bootloader Bonding Problem and also encountered by us from the beginning (and many others as we search the forums). We did not need the OTA feature until some short time ago and we have the problem with bonded data that is not consistent from Application to Stack project of our OTA upgradable stack project. In the linked attached a step by step description of the problem is present. Basically we use some custom boards based on CY8C4248LQI-BL573 chip and we implemented in application project the privacy features from example BLE_4.2_DataLength_Security_Privacy. Everything is fine in application and also the bonding is ok with persistent data between resets, on-off, and OTA upgrade. The problem is that when the code is trying to do an OTA and the execution goes to Stack project the bonding data is not present -> the user has to remove the device from system devices on android/ios and remove from devices list when using the Cypress dongle. Moreover in our example you cannot do an OTA if there is no bonded devices when the execution reached the stack project.
Attached is an example project that can be easily run on PSOC 4-ble dev board. If anyone has successfully realized this or have some hints in this direction it would be great. I also opened a ticket for technical support at cypress but as from the last response I was redirected to this forum for more help.
Execution of code: using dongle or smartphone connect to device, pair code is 123456, fixed. After connecting you can write to the only writable characteristic the value 0x0D. The code will go in Stack and if bonding data is not present the code will go again in application. We tried several approaches but every time you need to unpair the device from system devices which is not acceptable. The user experience will be very bad and basically the OTA is useless.
TestBLE.cywrk.Archive02.zip 2.8 MB