Issue with HAB in imx6ul

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Issue with HAB in imx6ul

2,113 Views
PramodKumar
Contributor IV

Hii Team ,

I am stuck at compilation time while compiling the backend code :

/code/back_end/src$ sudo gcc -o cst_encrypt -I ../hdr/ -L ../../../linux64/lib/ *.c -lfrontend -lcrypto

/tmp/cc4bzYms.o: In function `sk_X509_new_null':
adapt_layer_openssl.c:(.text+0x5): undefined reference to `OPENSSL_sk_new_null'
/tmp/cc4bzYms.o: In function `sk_X509_push':
adapt_layer_openssl.c:(.text+0x2a): undefined reference to `OPENSSL_sk_push'
/tmp/cc4bzYms.o: In function `sk_X509_pop_free':
adapt_layer_openssl.c:(.text+0x4f): undefined reference to `OPENSSL_sk_pop_free'
/tmp/cc4bzYms.o: In function `gen_sig_data_ecdsa':
adapt_layer_openssl.c:(.text+0xa4f): undefined reference to `EVP_PKEY_get0_EC_KEY'
adapt_layer_openssl.c:(.text+0xa8d): undefined reference to `EVP_PKEY_get0_EC_KEY'
adapt_layer_openssl.c:(.text+0xbda): undefined reference to `ECDSA_SIG_get0'
/tmp/ccEUeeCH.o: In function `generate_hash':

openssl_helper.c:(.text+0x1f): undefined reference to `EVP_MD_CTX_new'
/tmp/ccffGshs.o: In function `sign_data':
openssl_helper.c:(.text+0x4b3): undefined reference to `EVP_MD_CTX_new'
openssl_helper.c:(.text+0x520): undefined reference to `EVP_MD_CTX_free'
openssl_helper.c:(.text+0x5a6): undefined reference to `EVP_MD_CTX_free'
openssl_helper.c:(.text+0x5c5): undefined reference to `EVP_MD_CTX_free'
/tmp/ccffGshs.o: In function `ver_sig_data':
openssl_helper.c:(.text+0xc8b): undefined reference to `EVP_PKEY_get0_RSA'
openssl_helper.c:(.text+0xd49): undefined reference to `ECDSA_SIG_set0'
openssl_helper.c:(.text+0xd78): undefined reference to `EVP_PKEY_get0_EC_KEY'
../../../linux64/lib//libfrontend.a(srk_helper.o): In function `srk_entry_pkcs1':
srk_helper.c:(.text+0x90): undefined reference to `EVP_PKEY_get0_RSA'
srk_helper.c:(.text+0xa8): undefined reference to `RSA_get0_key'
../../../linux64/lib//libfrontend.a(srk_helper.o): In function `srk_entry_ec':
srk_helper.c:(.text+0x564): undefined reference to `EVP_PKEY_get0_EC_KEY'
srk_helper.c:(.text+0x5d3): undefined reference to `EVP_PKEY_get0_EC_KEY'
/usr/bin/ld: ../../../linux64/lib//libfrontend.a(err.o): unrecognized relocation (0x2a) in section `.text'
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status

Kindly look into this ,

Regards ,

Pramod .

Labels (2)
5 Replies

1,943 Views
igorpadykov
NXP Employee
NXP Employee

Hi Pramod

one can check attached document with detailed steps, hope this helps.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,943 Views
PramodKumar
Contributor IV

Hii Igor ,

Can you please clear me that how to perform the below part :

2.3 The mfgtool ucl command to program SRK_HASH fuse is

        <!-- program SRK_HASH fuse -->

        <CMD state="Updater" type="push" body="$ echo 0x5eadf50f > /sys/fsl_otp/HW_OCOTP_SRK0">Program SRK0 </CMD>

        <CMD state="Updater" type="push" body="$ echo 0x01d58e64 > /sys/fsl_otp/HW_OCOTP_SRK1">Program SRK1 </CMD>

        <CMD state="Updater" type="push" body="$ echo 0xd651af1b > /sys/fsl_otp/HW_OCOTP_SRK2">Program SRK2 </CMD>

        <CMD state="Updater" type="push" body="$ echo 0xea67d65d > /sys/fsl_otp/HW_OCOTP_SRK3">Program SRK3 </CMD>

        <CMD state="Updater" type="push" body="$ echo 0x73e682b0 > /sys/fsl_otp/HW_OCOTP_SRK4">Program SRK4 </CMD>

        <CMD state="Updater" type="push" body="$ echo 0x246cc832 > /sys/fsl_otp/HW_OCOTP_SRK5">Program SRK5 </CMD>

        <CMD state="Updater" type="push" body="$ echo 0x3c91b8c4 > /sys/fsl_otp/HW_OCOTP_SRK6">Program SRK6 </CMD>

        <CMD state="Updater" type="push" body="$ echo 0xfb5fbba6 > /sys/fsl_otp/HW_OCOTP_SRK7">Program SRK7 </CMD>

Thank in advance ,

Pramod

0 Kudos

1,943 Views
igorpadykov
NXP Employee
NXP Employee

Hi Pramod

this is part of ucl2.xml script included in mfg tool package on link

i.MX Software | NXP 

for example i.MX Series Manufacturing Toolkit for Linux 4.1.15_2.1.0 Release

also one can check sect. F2 AN4581 Secure Boot with its example

https://www.nxp.com/docs/en/application-note/AN4581.pdf 

Best regards
igor

1,943 Views
PramodKumar
Contributor IV

Hii Igor ,

After done this step the board stops booting and uboot is also not booting up .

3.4 Download u-boot-signed-pad.bin to SD

        $ sudo dd if=u-boot-signed-pad.bin of=/dev/sdx bs=1K seek=1

I think there is some mistake in this step but as per similar documents I have run the

 

        $ sudo dd if=u-boot-signed.imx of=/dev/sdx bs=512 seek=2

then board starts boting but hab_status was disabled showed by hab_status command .

mean the device is in open condiftion then I tried to close it by :

=> fuse prog 0 6 0x2

But after it the board stops booting from scratch . 

Regards ,
Pramod .
0 Kudos

1,943 Views
PramodKumar
Contributor IV

Hii Igor ,

Let me go through it then i will get back to you . But , I have tried so many of steps same as the document provided by you .

Regards ,

Pramod Kumar

0 Kudos