Secure Image for PSOC6

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
RaJa_4220491
Level 1
Level 1

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

0 Likes
1 Solution

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

View solution in original post

0 Likes
12 Replies
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

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

lock attach
Attachments are accessible only for community members.

Hi Dhiraj,

Yes I have copied the complete directory.

Thanks

Ranjit

0 Likes

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

0 Likes
Rolf_Nooteboom
Level 5
Level 5
10 sign-ins 5 solutions authored First solution authored

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

0 Likes
lock attach
Attachments are accessible only for community members.

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

0 Likes

Hello Ranjit,

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

Regards,

Dheeraj

0 Likes
lock attach
Attachments are accessible only for community members.

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"

0 Likes
lock attach
Attachments are accessible only for community members.

Attaching log.txt file

Thanks

Ranjit

0 Likes

Hello Ranjit,

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

Regards,

Dheeraj

0 Likes
lock attach
Attachments are accessible only for community members.

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

0 Likes

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

0 Likes
Rolf_Nooteboom
Level 5
Level 5
10 sign-ins 5 solutions authored First solution authored

Use OpenSSL 1.0.2

0 Likes