5 Replies Latest reply on Apr 28, 2019 10:11 PM by GyanC_36

    OTA Fixed Stack Dual App Bootloader on CY8CKIT-042-BLE-A

    phmec_3804456

      GyanC_36 posted (Dual-application support when using BLE OTA ) an example project for a Dual Application Bootloader for the device CY8C4247LQI-BL483 56-QFN. I like to run this example project on my CY8CKIT-042-BLE-A PIONEER KIT.

       

      I need for my project at university a working Fixed Stack OTA using BLE , so I hope anyone can help me to run this simple example.

       

      Using the Device Selector, I changed the device for both projects (Bootloader and Bootloadable to CY8C4248LQI-BL583 56-QFN. Also, I changed the device parameters in cm0gcc.ld (Bootloader) and cm0g_1.ld and cm0g_2.ld (Bootloadable) like described in "BLE OTA Fixed Stack Bootloader and Bootloadable, 1.40", to rom LENGTH = 262144, ram LENGTH = 32768 and CY_FLASH_ROW_SIZE = 256.

       

      Then I built the Bootloader project, run the mk.bat file and programmed the bootloader project on my PIONEER KIT. After that, I built the Bootloadable project. With the CySmart 1.3 tool I tried to update the firmware.

       

      The update firmware process for both *.cyacd files ("BLE_OTA_FixedStack_Bootloadable01_1.cyacd" or "BLE_OTA_FixedStack_Bootloadable01_2.cyacd") failed with error: "The row checksum does not match the computed value".

       

      It seems to me, that the whole file is sent successfully and the last step failed but I don't know how to fix this.

       

      Does anyone know, what's going wrong?

       

      I attached both .log-files from CySmart tool and my corrected sample project.

        • 1. Re: OTA Fixed Stack Dual App Bootloader on CY8CKIT-042-BLE-A
          GyanC_36

          Hi Philipp,

           

               I think you need to set the Active Application Status Matadata before starting the bootloading in Bootloader project. We will check and let you know our updates.

           

          Meanwhile you can start your development by programming the Bootloadble1 project along with the bootloader project itself and then switch to Bootloader ( by pressing button ) and update the second image.

           

          -Gyan

          • 2. Re: OTA Fixed Stack Dual App Bootloader on CY8CKIT-042-BLE-A
            phmec_3804456

            Hello Gyan,

             

            how can I programm the bootloadable project along with the bootloader project itself?

            Do I have to use BLE?

             

            -Philipp

            • 3. Re: OTA Fixed Stack Dual App Bootloader on CY8CKIT-042-BLE-A
              GyanC_36

              Hi Philipp,

               

                Just build the bootloader project -> Build the Bootloadable project by adding the bootloader dependencies -> Program the bootloadable project. ( The Bootloader project will be automatically programmed along with Bootloadable project )

               

               

              For bootloading and running a new image , you need to deactivate the current image running already ( need to update the metadata) either in bootloadable ( before switching to bootloader ) or in bootloader project by means of an external/internal control.

               

              To make a application active or deactive, you need to use the following API.

               

              Bootloader_SetFlashByte((uint32) (Bootloader_MD_BTLDB_ACTIVE_OFFSET(0)),1);   // First argument corresponds to the Application ID ( First (0) or second(1)) and the second argument is corresponds to Active (1) or deactive (0)

               

               

              -Gyan

               

               

              • 4. Re: OTA Fixed Stack Dual App Bootloader on CY8CKIT-042-BLE-A
                phmec_3804456

                Hi Gyan,

                 

                it helped to programm the Bootloader along with Bootloadable #0, but the API didn't support the programming process. After sending the Bootloadable#1 the computed checksum might be false.

                 

                Am I right, assuming bootloadable #0 symbolize file: "BLE_OTA_FixedStack_Bootloadable01_1.cyacd" and bootloadable #1 symbolize file: "BLE_OTA_FixedStack_Bootloadable01_2.cyacd"?

                 

                Programming the Bootloadable#0 with Bootloader works fine and Bootloadable #0 is execute as desired. Sending Bootloadable#1 /  "BLE_OTA_FixedStack_Bootloadable01_2.cyacd" returns error ("The row checksum...."), if option auto application switching is disabled. If auto application switching is enabled, the Bootloader runs application#0 instead of application #1  and returns no error.

                 

                The Command "Get Row Checksum (0x3A)" is declared as optional. Either turning off this command in bootloader options, didn't help. After sending the whole file  "BLE_OTA_FixedStack_Bootloadable01_2.cyacd" CySmart returns an error: " The bootloader reported error 'Command not recognized: the supported commands are defined in the Bootloader section of the System Reference Guide'".

                • 5. Re: OTA Fixed Stack Dual App Bootloader on CY8CKIT-042-BLE-A
                  GyanC_36

                  Hi Philipp,

                   

                    Please find the attached modified version of the project.

                   

                  Description: Bootloader Project selects the Active App based on GPIO Status (P3.0). See the function active_app() in bootloader project. Please note that to bootload an image we need to make it inactive before the bootloading starts.

                  Since both the images are exactly same in this project  , so you  might not be able to distinguish between two images based on UART prints.

                   

                  -Gyan