Other Parts Discussed in Thread: SYSCONFIG, UNIFLASH
Hello,
I'm trying to run the SDK SBL example using the Android partitions, without success. Although the SPL seems to be working fine, when executing the Bootloader_parseMultiCoreAppImage function, it fails.

Partition layout:
=> mmc part
Partition Map for MMC device 0 -- Partition Type: EFI
Part Start LBA End LBA Name
Attributes
Type GUID
Partition GUID
1 0x00002800 0x000067ff "bootloader"
attrs: 0x0000000000000000
type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
guid: 2e6bff3e-e8f8-604e-b078-271fe40c09f5
2 0x00002000 0x000027ff "tiboot3"
attrs: 0x0000000000000000
type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
guid: 07dbea06-fe2b-2949-9533-aed11b974fec
3 0x00006c00 0x00006fff "misc"
attrs: 0x0000000000000000
type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
guid: e69515ae-007e-c04e-a6cc-0906687e3fcc
4 0x00007000 0x0001afff "boot_a"
attrs: 0x0000000000000000
type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
guid: df131c31-2d1b-2e49-9652-d3789ef0a240
5 0x0001b000 0x0002efff "boot_b"
attrs: 0x0000000000000000
type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
guid: a71712bd-93bd-ed42-8fe9-885b77789490
6 0x0002f000 0x0003efff "vendor_boot_a"
attrs: 0x0000000000000000
type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
guid: c0ffcdf9-da79-114e-9171-2288f5780e07
7 0x0003f000 0x0004efff "vendor_boot_b"
attrs: 0x0000000000000000
type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
guid: 1c62fc47-8bf2-3e4d-bb0f-a275fddee3bd
8 0x0004f000 0x00052fff "init_boot_a"
attrs: 0x0000000000000000
type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
guid: 47feb651-07ab-b74f-86cc-13bc63aee674
9 0x00053000 0x00056fff "init_boot_b"
attrs: 0x0000000000000000
type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
guid: b3f75435-c92d-774a-9abd-80e3af6e5b71
10 0x00057000 0x0005afff "dtbo_a"
attrs: 0x0000000000000000
type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
guid: c93899dd-cf5c-9a49-bdcd-c1d3ce19a5a6
11 0x0005b000 0x0005efff "dtbo_b"
attrs: 0x0000000000000000
type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
guid: 49a83e25-9b73-834b-99e4-25e20a827b8a
12 0x0005f000 0x0005f07f "vbmeta_a"
attrs: 0x0000000000000000
type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
guid: b3f4c13e-8e37-5141-8c9f-9c6e7a46c150
13 0x0005f080 0x0005f0ff "vbmeta_b"
attrs: 0x0000000000000000
type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
guid: 3c940d44-a89a-1a46-8067-0439768b6b08
14 0x0005f100 0x0095f0ff "super"
attrs: 0x0000000000000000
type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
guid: 8fd58137-a70e-c14c-b0fb-d4fa41e5fbd1
15 0x0095f100 0x009670ff "metadata"
attrs: 0x0000000000000000
type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
guid: e29466b3-03d2-a644-8d4d-b4e92375a663
16 0x00967100 0x009770ff "persist"
attrs: 0x0000000000000000
type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
guid: 28237f13-a293-bf46-a91e-2a1d5a320582
17 0x00977100 0x03b47fde "userdata"
attrs: 0x0000000000000000
type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
guid: fa2843af-8aa1-b946-b841-e17e7738138d
After adding some traces, I understood that the information read from the eMMC doesn't match what I expected to read, but I don't understand why.
When reading, within the Bootloader_verifyMulticoreImage function, partition 1 of the eMMC is opened (which in this case should be the bootloader).
The first two data read are: 0x30 and 0x82, but then the length is different and the verification fail.

Note: I modified the offset of my image in the sysconfig of the example. I set it to 0, since my image inside the bootloader partition does not have an offset.
uint32_t Bootloader_getX509CertLen(uint8_t *x509_cert_ptr)
{
uint32_t certLen = 0;
uint8_t *pCertLen = (uint8_t *)&certLen;
DebugP_logError("*x509_cert_ptr: 0x%x, 0x%x, 0x%x, 0x%x\r\n", *x509_cert_ptr, *(x509_cert_ptr+1), *(x509_cert_ptr+2), *(x509_cert_ptr+3));
if ( *x509_cert_ptr != (uint8_t)0x30)
{
return (uint32_t)0;
}
*pCertLen = *(x509_cert_ptr + 1);
/* If you need more than 2 bytes to store the cert length */
/* it means that the cert length is greater than 64 Kbytes */
/* and we do not support it */
if ((certLen > (uint32_t)0x80) &&
(certLen != (uint32_t)0x82))
{
return (uint32_t)0;
}
if ( certLen == (uint32_t)0x82)
{
*pCertLen = *(x509_cert_ptr + 3);
*(pCertLen + 1) = *(x509_cert_ptr + 2);
/* add current offset from start of x509 cert */
DebugP_logError("certLen: 0x%x\r\n", certLen);
certLen += 3;
}
else
{
/* add current offset from start of x509 cert */
/* if cert len was obtained from 2nd byte i.e. */
/* cert size is 127 bytes or less */
certLen += 1;
}
/* certLen now contains the offset of the last byte */
/* of the cert from the ccert_start. To get the size */
/* of certificate, add 1 */
return certLen + (uint32_t)1;
}
To check the memory content I did this:

Thank you,
Franco