12 Replies Latest reply on Jun 10, 2019 3:23 AM by RoNo_264271

    Secure Image for PSOC6

    RaJa_4220491

      Hello,

       

      I'm trying to compile and run the Cypress Secure Image template application, included in the PDL 3.0.1 in the security/secure_image folder.

      I am getting the error as

      ".\CortexM0p\ARM_GCC_541\Debug\secure_image.elf.tmp: openssl error:"

       

      Then i have refered the post

      https://community.cypress.com/message/191971#191971

      As per suggestion i did below mention changes

       

      1. Used the post-build command "secure_image_postbuild.bat ${Platform} ${OutputDir} ${ProjectShortName}" .

      2. Openssl version

         C:\Users\Lenovo>openssl version

         OpenSSL 1.1.1c  28 May 2019

        

      3. Also set environment variables correctly  

       

      But still I am facing getting the openssl error after building secure_image project

       

      ".\CortexM0p\ARM_GCC_541\Debug\secure_image.elf.tmp: openssl error:"

       

      Thanks

      Ranjit

        • 1. Re: Secure Image for PSOC6
          DheerajK_81

          Make sure you have copied the entire "secure_image" directory. It will contain three folders as mentioned below:

          (1) elf

          (2) example -> contains the secure_image.cydsn

          (3) src -> contains the secure_image_postbuild.bat inside scripts folder

           

          So, considering you have the same folder structure, you can directly build the secure_image project since the postbuild command by default is: "../../src/scripts/secure_image_postbuild.bat ${Platform} ${OutputDir} ${ProjectShortName}" . This corresponds to the bat file going two levels down to get the src folder.

           

          In short just make sure you copy the entire directory and not just the Creator project. Your openssl version is correct.

           

          Regards,

          Dheeraj

          1 of 1 people found this helpful
          • 2. Re: Secure Image for PSOC6
            RaJa_4220491

            Hi Dhiraj,

             

             

            Yes I have copied the complete directory.

             

             

             

             

             

            Thanks

             

            Ranjit

            • 3. Re: Secure Image for PSOC6
              DheerajK_81

              Open the command prompt in the secure_image.cydsn directory and run the following command:

              ..\..\src\scripts\secure_image_postbuild.bat ARM_GCC_541 .\CortexM0p\ARM_GCC_541\Debug secure_image

               

              cmd1.png

               

              I have the same version of openssl and it works for me. So, copy the logs from the cmd into a file and then attach it to the thread. It will give more insights into the error. Also, in your "secure_image.cydsn\CortexM0p\ARM_GCC_541\Debug" folder check if you have the file secure_image.elf or not. Did you make any modifications to the project?

               

              In the build settings of the project, I hope the Peripheral Driver Library is set to 3.0.1.

              cmd2.png

               

              Regards,

              Dheeraj

              • 4. Re: Secure Image for PSOC6
                RoNo_264271

                Install OpenSSL and make sure it runs from command line (the executable’s folder has to be in the path environment variable)

                • 5. Re: Secure Image for PSOC6
                  RaJa_4220491

                  Hi Dhiraj,

                   

                   

                    1.  After installing openssl , i make sure that it runs through command line.

                   

                             I am able to run command "openssl version" and its giving output as " OpenSSL 1.1.0k"

                   

                              

                   

                         2. Also I have added the system environment variable path as shown in screenshot.

                   

                             PATH = C:\Program Files\OpenSSL-Win64\bin

                   

                   

                   

                   

                  Please find the attached screenshot

                   

                   

                  Thanks & regards

                   

                  Ranjit

                  • 6. Re: Secure Image for PSOC6
                    DheerajK_81

                    Hello Ranjit,

                     

                    Please share your logs by performing the steps I mentioned above.

                     

                    Regards,

                    Dheeraj

                    • 7. Re: Secure Image for PSOC6
                      RaJa_4220491

                      Hi Dhiraj,

                       

                       

                        1.  Open the command prompt in the secure_image.cydsn directory and run the following command:

                       

                       

                       

                       

                            - Please find the attached log.txt file

                       

                       

                      2. Also, in your "secure_image.cydsn\CortexM0p\ARM_GCC_541\Debug" folder check if you have the file secure_image.elf or not. Did you make any modifications to the project?

                       

                      - Yes file secure_image.elf available on same path.

                       

                         i did not made any changes .

                       

                       

                       

                       

                      3 .In the build settings of the project, I hope the Peripheral Driver Library is set to 3.0.1.

                       

                          Yes I have set PDL to 3.0.1

                       

                       

                       

                       

                      4. Also after building the secure image i am getting opessl error as below

                       

                          Its showing build succeeded but with openssl error.  I have highlighted the error with "Bold Red"

                      • 8. Re: Secure Image for PSOC6
                        RaJa_4220491

                        Attaching log.txt file

                         

                         

                        Thanks

                         

                        Ranjit

                        • 9. Re: Secure Image for PSOC6
                          DheerajK_81

                          Hello Ranjit,

                           

                          The logs don't seem to have the openssl error you mentioned. Which line contains the error?

                           

                          Regards,

                          Dheeraj

                          • 10. Re: Secure Image for PSOC6
                            RaJa_4220491

                            HI Dhiraj,

                             

                             

                            Please find the attached build log for secure image.

                             

                            Error line as below :

                             

                             

                            openssl dgst -sha256 -binary -out ".\CortexM0p\ARM_GCC_541\Debug\secure_image.elf.tmp.raw.hash" ".\CortexM0p\ARM_GCC_541\Debug\secure_image.elf.tmp.raw"

                            .\CortexM0p\ARM_GCC_541\Debug\secure_image.elf.tmp: openssl error:

                            C:\Prj_mbed_TLS\Documents\PSOC_RSA_Implementation\Secure_image_PDL_3.0.1\secure_image\example\secure_image.cydsn>if not exist "C:\Prj_mbed_TLS\Documents\PSOC_RSA_Implementation\Secure_image_PDL_3.0.1\secure_image\src\scripts\..\..\elf\GCC" mkdir "C:\Prj_mbed_TLS\Documents\PSOC_RSA_Implementation\Secure_image_PDL_3.0.1\secure_image\src\scripts\..\..\elf\GCC"

                             

                            Thanks

                             

                            Ranjit

                            • 11. Re: Secure Image for PSOC6
                              DheerajK_81

                              After adding the path variable for Openssl, did you restart Creator? From the files you attached, the openssl signing works using the command prompt which means that openssl is working.

                               

                              In Creator, it may not yet have got the updated environment variables and hence is failing. Please restart Creator and try again. Let me know how it goes.

                               

                              Regards,

                              Dheeraj

                              • 12. Re: Secure Image for PSOC6
                                RoNo_264271

                                Use OpenSSL 1.0.2