Hi there,
I'm facing the same issue... I tried a lot of different ways to get my u-boot_signed.imx working over SDP load...
Here are the important parts:
Image details:
Image Type: Freescale IMX Boot Image
Image Ver: 2 (i.MX53/6/7 compatible)
Mode: DCD
Data Size: 274432 Bytes = 268.00 KiB = 0.26 MiB
Load Address: 877ff420
Entry Point: 87800000
HAB Blocks: 877ff400 00000000 00040c00
DCD Blocks: 00910000 0000002c 00000210
CSF:
[Header]
Version = 4.1
Hash Algorithm = sha256
Engine Configuration = 0
Certificate Format = X509
Signature Format = CMS
Engine = ANY
[Install SRK]
File = "../crts/SRK_1_2_3_4_table.bin"
Source index = 0
[Install CSFK]
File = "../crts/CSF1_1_sha256_4096_65537_v3_usr_crt.pem"
[Authenticate CSF]
[Install Key]
# Key slot index used to authenticate the key to be installed
Verification index = 0
# Key to install
Target index = 2
File = "../crts/IMG1_1_sha256_4096_65537_v3_usr_crt.pem"
[Authenticate Data]
Verification index = 2
Blocks = 0x877ff400 0x0 0x00040c00 "u-boot.imx", \
0x00910000 0x0000002c 0x00000210 "u-boot.imx"
#HAB Blocks: 877ff400 00000000 00040c00
#DCD Blocks: 00910000 0000002c 00000210
for the signing process i've done it like it is described here:
High Assurance Boot (HAB) for dummies - Boundary Devices
so, remove the DCD pointer-> do the cst -> write back the pointer -> attache the signature.
I still got this HAB events:
U-Boot > hab_status
Secure boot disabled
HAB Configuration: 0xf0, HAB State: 0x66
--------- HAB Event 1 -----------------
event data:
0xdb 0x00 0x08 0x41 0x33 0x22 0x0a 0x00
STS = HAB_FAILURE (0x33)
RSN = HAB_INV_ADDRESS (0x22)
CTX = HAB_CTX_AUTHENTICATE (0x0A)
ENG = HAB_ENG_ANY (0x00)
--------- HAB Event 2 -----------------
event data:
0xdb 0x00 0x08 0x41 0x33 0x22 0x0a 0x00
STS = HAB_FAILURE (0x33)
RSN = HAB_INV_ADDRESS (0x22)
CTX = HAB_CTX_AUTHENTICATE (0x0A)
ENG = HAB_ENG_ANY (0x00)
--------- HAB Event 3 -----------------
event data:
0xdb 0x00 0x08 0x41 0x33 0x22 0x0a 0x00
STS = HAB_FAILURE (0x33)
RSN = HAB_INV_ADDRESS (0x22)
CTX = HAB_CTX_AUTHENTICATE (0x0A)
ENG = HAB_ENG_ANY (0x00)
--------- HAB Event 4 -----------------
event data:
0xdb 0x00 0x08 0x41 0x33 0x22 0x0a 0x00
STS = HAB_FAILURE (0x33)
RSN = HAB_INV_ADDRESS (0x22)
CTX = HAB_CTX_AUTHENTICATE (0x0A)
ENG = HAB_ENG_ANY (0x00)
--------- HAB Event 5 -----------------
event data:
0xdb 0x00 0x14 0x41 0x33 0x0c 0xa0 0x00
0x00 0x00 0x00 0x00 0x87 0x7f 0xf4 0x00
0x00 0x00 0x00 0x20
STS = HAB_FAILURE (0x33)
RSN = HAB_INV_ASSERTION (0x0C)
CTX = HAB_CTX_ASSERT (0xA0)
ENG = HAB_ENG_ANY (0x00)
--------- HAB Event 6 -----------------
event data:
0xdb 0x00 0x14 0x41 0x33 0x0c 0xa0 0x00
0x00 0x00 0x00 0x00 0x87 0x80 0x00 0x00
0x00 0x00 0x00 0x04
STS = HAB_FAILURE (0x33)
RSN = HAB_INV_ASSERTION (0x0C)
CTX = HAB_CTX_ASSERT (0xA0)
ENG = HAB_ENG_ANY (0x00)
I have to say, I do no padding on the image file. But as far as I know, this is not necessary... or am I wrong?
I do not really understand this padding sizes that I've found in a example.
#!/bin/bash PROG_NAME=my_code
# ${PROG_NAME} padded up to 0x2C000 where the CSF will be added later
objcopy -I binary -O binary --pad-to 0x2C000 --gap-fill=0xff ${PROG_NAME}.bin ${PROG_NAME}_padded.bin
# DCD address must be cleared for signature, as mfgtool will clear it.
./mod_4_mfgtool.sh clear_dcd_addr ${PROG_NAME}_padded.bin
# generate the signatures, certificates, … in the CSF binary
../linux64/bin/cst --o ${PROG_NAME}_csf.bin --i ${PROG_NAME}.csf
# DCD address must be set for mfgtool to localize the DCD table.
./mod_4_mfgtool.sh set_dcd_addr ${PROG_NAME}_padded.bin
# gather ${PROG_NAME} + its CSF cat ${PROG_NAME}_padded.bin ${PROG_NAME}_csf.bin > ${PROG_NAME}_tmp.bin
# padding to get a file with size like specified in the IVT
objcopy -I binary -O binary --pad-to 0x22000 --gap-fill=0xff ${PROG_NAME}_tmp.bin ${PROG_NAME}_signed.bin
# remove temporary file
rm ${PROG_NAME}_tmp.bin
Where come this 0x2C00 and 0x22000 sizes from? How will this fit into my image?
Maybe this padding is the last point I have to fix.
And an other issue that I have. Since I have "closed" my device and flashed a signed u-boot (not over SDP).
the i.MX 6 Solo X boots not every time I do a reset or power off/on. It boots about every 3rd or 5th time up...
An other i.MX 6 Solo X board that is not "closed" boots up every time.
And I have also a i.MX 6 in "closed" mode, this one also boots normal and every time after reset.
It looks like the i.MX 6 Solo X has sometime problems to verify the signature of the u-boot and then it does not boot...
Anyone faced this problem before?
Thanks guys