3 Replies Latest reply on Nov 17, 2020 10:08 PM by TaTa_2447651

    When I call Cy_BLE_StoreBondingData(), the return value will be CY_BLE_ERROR_FLASH_WRITE.

    TaTa_2447651

      I am developing a product using CYBLE-416045-02.

       

      To implement the BLE pairing process, I used the CE212742 sample project as a reference.

      From this sample project I ported the code needed for the product.

      When paired using the Windows CySmart application, the return value of Cy_BLE_StoreBondingData() will be CY_BLE_ERROR_FLASH_WRITE.

      When I kept calling this function, the microcontroller was restarted.

       

      In the product project, BLE components are located on the CM0+ side, and all BLE source code is running on the CM0+ side.

       

      Is there any restriction that Cy_BLE_StoreBondingData() should not be used on the CM0+ side?

       

      Best regards.

        • 1. Re: When I call Cy_BLE_StoreBondingData(), the return value will be CY_BLE_ERROR_FLASH_WRITE.
          TaTa_2447651

          When the result of Cy_BLE_StoreBondingData() becomes CY_BLE_ERROR_FLASH_WRITE, the same phenomenon occurs when the following two sample projects are combined.

           

          CE222802

          CE212742

           

          I've embedded the CE212742 process into the App101 project in CE222802.

          The CE212742 project was running BLE on the CM4 side, but I have modified it to work on the CM0+ side.

           

          Attached is a project where the issue occurs.

           

          What is the cause of this issue?

          Best regards.

          • 2. Re: When I call Cy_BLE_StoreBondingData(), the return value will be CY_BLE_ERROR_FLASH_WRITE.
            GaneshD_41

            Hi,

             

            Is there any restriction that Cy_BLE_StoreBondingData() should not be used on the CM0+ side?

            There is no restriction of calling the Cy_BLE_StoreBondingData() function from the CM4. You can call it from CM0+ also.

             

            Please note that you have to call the Cy_BLE_StoreBondingData() API only when cy_ble_pendingFlashWrite value is non zero.

             

            if(cy_ble_pendingFlashWrite != 0u) 
                    {   
                        apiResult = Cy_BLE_StoreBondingData();    
                        DBG_PRINTF("Store bonding data, status: %x, pending: %x \r\n", apiResult, cy_ble_pendingFlashWrite);
                    }
            

             

            Please find the attached project where the API is called from CM0+. Please confirm if this is working for you. Once this works, you can use the same project and modify accordingly. Please update if the above project is not working for you.

             

            Thanks

            Ganesh

            • 3. Re: When I call Cy_BLE_StoreBondingData(), the return value will be CY_BLE_ERROR_FLASH_WRITE.
              TaTa_2447651

              Hi Ganesh.

               

              Thanks for the reply.

               

              I have used the sample project in CE212742 in the past and I have made the BLE to be handled on the CM0+ side.

              At that time, the Cy_BLE_StoreBondingData() function worked correctly.

              I also understand using the Cy_BLE_StoreBondingData() function when cy_ble_pendingFlashWrite is not zero.

               

              The problem I have is as follows.

               

              I have merged the CE212742 sample project into the CE222802 sample project. I then modified the BLE to handle the CM0+ side of the project.

              I am coding to use the Cy_BLE_StoreBondingData() function when cy_ble_pendingFlashWrite is not zero, but the result of the Cy_BLE_StoreBondingData() function is CY_BLE_ERROR_FLASH_WRITE.

               

              The project I tried is attached in the second comment.

              I used the CY8CPROTO-063-BLE board.

               

              Best regards.