4 Replies Latest reply on Sep 2, 2020 3:31 AM by JaOr_4642046

    Psoc 4/ Psoc 5: Custom bootloader with SPI to external memory

    JaOr_4642046

      Hi all

       

      The is idea:

       

      I got two MCU, Psoc (BLE), PSoc 5 and an external memory (SPI FLASH). The procedure would be:

            1) PSoc 4 (BLE) receives an image (bootloadable#1) from external device and record this image in external memory.

            2)  After that, "bootloader 1" starts and the image is moved from external memory to internal memory of PSoc 4

            3) PSoc 4 (BLE) receives another image (bootloadable#2) from external device and record this image in external memory (over the previous one)

            4)  I disable the UART/SPI block (to avoid noise in the tx/rx lines), and from PSoc5  "bootloader 2" starts and the image is moved from external memory to internal memory of PSoc 5

       

      ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

      This is the idea and the steps 1) and 2) are working.

      The step 3) is similar to step 1),  with the difference of the bootloadable (one is for PSoc 4 and the other is for PSoc 5), but when I try to transfer this image from external device to the Flash memory, in this case doesn't work.

       

      Any idea? I have been using the cypress example for SPI based external memory bootloader project.

      PSoC-4-BLE/100_Projects_in_100_Days/Project051_NOR_Flash_Bootloader at master · cypresssemiconductorco/PSoC-4-BLE · GitH…

       

      I attach the two logs, first one with the result of  steps 1) and 2) working properly. The second one with the error when I try to do the step 3)

       

      Thanks.

       

      Regards

        • 1. Re: Psoc 4/ Psoc 5: Custom bootloader with SPI to external memory
          GaneshD_41

          Hi,

           

          " 3) PSoc 4 (BLE) receives another image (bootloadable#2) from external device and record this image in external memory (over the previous one)"

           

          --> In this step, are you transferring the .cyacd file for the PSoC 5LP device? If yes, kindly note that the OTA application is written in such a way to update only the .cyacd file generated using the Bootloader project only will be able to get bootloaded over the air.

           

          --> For your application, we recommend you to create a new application using the existing CySmart windows files so that you can write the .cyacd file of your PSoC 5 LP based application.

           

          Thanks

          Ganesh

          • 2. Re: Psoc 4/ Psoc 5: Custom bootloader with SPI to external memory
            JaOr_4642046

            Hi Ganesh, (Thanks).

             

            I am sorry but I don't understand well you suggest.

             

            As you mentioned above. I am working, with PSoc 4 and PSoc 5  in the same project. And I am using the file .cyacd of PSoc 4 (step 1) and the file .cyacd of PSoc 5 (step 3), to load these images on the external memory, one each time.

             

            I need to use a mobile App to send both files.

                a) First I send the "PSoC4.cyacd" image to the external memory and it is record to this memory "without" problem, later the image is download to the internal memory of PSoc 4. (these steps are working fine).

                b) Second, I am trying to send the "PSoc5.cyacd" image to the external memory, for this process I need to use the BLE_OTA procedure like before (but doesn't work).

            When this works, the bootloader of PSoc 5 is will start to transfer the image from external memory to internal memory of PSoc 5  (or this is the idea).

             

            --> In this step, are you transferring the .cyacd file for the PSoC 5LP device? If yes, kindly note that the OTA application is written in such a way to update only the .cyacd file generated using the Bootloader project only will be able to get bootloaded over the air.

             

            That does mean there is no way to transfer the PSoc 5 image to the external memory using the BLE_OTA (PSoc 4)?

            I thought if I could upload the PSoc 5 image in external memory using the PSoc 4 OTA canal, later I could restart the PSoc 5 and use its bootloader to upload this image from external memory to PSoc 5 internal memory.

             

            Is it not possible?

             

            --> For your application, we recommend you to create a new application using the existing CySmart windows files so that you can write the .cyacd file of your PSoC 5 LP based application.

             

            I am sorry, Could you explain a bit more what do you means?,  also .....  what do you means with "using the existing CySmart windows files" ?

             

             

            Thank you very, very much.

             

            Best regards.

            • 3. Re: Psoc 4/ Psoc 5: Custom bootloader with SPI to external memory
              GaneshD_41

              Hi,

               

              Sorry for not being clear in my previous response.

               

              The External memory Bootloader project is designed to bootload the bootloadable projects of the same BLE family(the BLE family of bootloader) only. In your case since you want to Bootload two different .cyacd files( one with PSoC 4 BLE and other with PSoC 5LP ) you cannot directly use the project directly. 

               

              So you need to develop your custom firmware for your application. For that you can use the source files of the CySmart 1.3 windows application. The source files are present at the following path:

               

              C:\Program Files (x86)\Cypress\CySmart\1.3

               

              At PSOC 4 BLE side you can use the custom BLE service to get the data from your windows application and store it in the external memory.

               

              Thanks

              Ganesh

              • 4. Re: Psoc 4/ Psoc 5: Custom bootloader with SPI to external memory
                JaOr_4642046

                Hi Ganesh,

                First I wanted to thank you.

                 

                I think there was a misunderstanding, probably I did not explain myself correctly.

                 

                The idea is sent two different images, one for PSoc 4 and other for PSoc 5 from an App (on a phone) using the BLE_OTA channel and save this image to an external memory.

                          a) When I send the PSoc 4 image (PSoc4.cyacd), from the App to the external memory through OTA, it is working properly. (I am using the cypress project mentioned above).

                          b) When I try to send the PSoc 5 (PSorc5.cyacd),  from the App to the external memory through OTA, it does not work.

                 

                I guess the problem is the way bootloadable receives the information when it is for PSoc 5,  I don't think it has anything to do with "the CySmart 1.3" since for a) it is works.

                 

                I mean, from my point of view, maybe I'm wrong, the communication channel is working, so I wouldn't have to do anything with CySmart files, rather, it will be something that must be modified in the Bootloadable external memory project in order to receive the image for the PSoc 5.  Could be like this?

                 

                Thanks