Tool/software:
Hi team,
I have encounter some issues while try to boot from encrypt images.
Where is need to adjust in linux SDK to encrypt for secure booting?
Thank you for your support.
Best Regards, KONG XIANGXU
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software:
Hi team,
I have encounter some issues while try to boot from encrypt images.
Where is need to adjust in linux SDK to encrypt for secure booting?
Thank you for your support.
Best Regards, KONG XIANGXU
Hello,
The Processor SDK doesn't have the encrypted boot support.
The MCU+ SDK does have the support which can be enabled using the flags "ENC_ENABLED" & "ENC_SBL_ENABLED" defined in the "devconfig/devconfig.mak" file.
Regards,
Prashant
Hi,
mcu_plus_sdk_am62px_10_00_00_14/examples/drivers/boot/sbl_sd_linux/am62px-sk/wkup-r5fss0-0_nortos/ti-arm-clang/sbl_sd_linux.debug.hs.tiimage ->tiboot3.bin
/home/a/ti/mcu_plus_sdk_am62px_10_00_00_14/examples/hello_world/am62px-sk/wkup-r5fss0-0_freertos/ti-arm-clang/hello_world.debug.appimage.hs ->wkup_r5_image
/a/ti/mcu_plus_sdk_am62px_10_00_00_14/examples/hello_world/am62px-sk/mcu-r5fss0-0_freertos/ti-arm-clang/hello_world.debug.appimage.hs ->mcu_r5_image
ti/mcu_plus_sdk_am62px_10_00_00_14/tools/boot/linuxAppimageGen/board/am62px-sk/linux.appimage.hs ->linux_a53_image
There are how I did it. Is this ok?
Is that all images I need to flash in order to boot on hs device?
Regards,
XIANGXU
There are how I did it. Is this ok?
I think yes. The boot should be successful.
Drivers_open() SYSFW Firmware Version 10.0.8--v10.00.08 (Fiery Fox) SYSFW Firmware revision 0xa SYSFW ABI revision 4.0 Sciclient_getVersionCheck(1) Bootloader_Handle bootHandleLinux Bootloader_Params_init Bootloader_BootImageInfo_init(&bootImageInfoLinux); noOfFiles < BOOTLOADER_SD_MAX_NO_OF_FILES pp_OpenloadableImage(pFiles[noOfFiles]) == SystemP_SUCCESS bootHandle = Bootloader_open(CONFIG_BOOTLOADER_APP, &bootParams); bootHandle != NULL 10:54 in Bootloader_getMulticoreImageSize --- Bootloader Configuration --- bootMedia: 0xB0070001 bootImageSize: 0 bytes coresPresentMap: 0x00000000 enableDma: false scratchMemPtr: 00000000 socCoreOpMode: 43C273D4 fxns: 43C26E64 args: 43C27304 Core Presence Map Interpretation: --- Bootloader Configuration --- bootMedia: 0xB0070001 bootImageSize: 0 bytes coresPresentMap: 0x00000000 enableDma: false scratchMemPtr: 00000000 socCoreOpMode: 43C273D4 fxns: 43C26E64 args: 43C27304 Core Presence Map Interpretation: Multicore image size: 0 bytes Image loading status: -1 status = App_loadImages(bootHandle, &bootImageInfo); Error: Failed to load images (0xFFFFFFFF) if(App_OpenloadableImage(BOOTLOADER_SD_A53_APPIMAGE_FILENAME) == SystemP_SUCCESS) [BOOTLOADER_PROFILE] Boot Media : SD Card [BOOTLOADER_PROFILE] Boot Image Size : 0 KB [BOOTLOADER_PROFILE] Cores present : [BOOTLOADER PROFILE] System_init : 29532us [BOOTLOADER PROFILE] Drivers_open : 2911us [BOOTLOADER PROFILE] Board_driversOpen : 1465us [BOOTLOADER PROFILE] Sciclient Get Version : 10167us [BOOTLOADER_PROFILE] SBL Total Time Taken : 44076us Image loading done, switching to application ... Starting linux and RTOS/Baremetal applications Some tests have failed!!
Here are logs from my tiboot3.bin(I added some logs).
Can you tell what might went wrong?
Can you tell what might went wrong?
There is nothing in the logs that could give any insights.
Could you please check where exactly the execution is failing inside the "App_loadImages" function?
Thanks!
Drivers_open() SYSFW Firmware Version 10.0.8--v10.00.08 (Fiery Fox) SYSFW Firmware revision 0xa SYSFW ABI revision 4.0 Sciclient_getVersionCheck(1) Bootloader_Handle bootHandleLinux Bootloader_Params_init Bootloader_BootImageInfo_init(&bootImageInfoLinux); noOfFiles < BOOTLOADER_SD_MAX_NO_OF_FILES pp_OpenloadableImage(pFiles[noOfFiles]) == SystemP_SUCCESS bootHandle = Bootloader_open(CONFIG_BOOTLOADER_APP, &bootParams); bootHandle != NULL in Bootloader_getMulticoreImageSize --- Bootloader Configuration --- bootMedia: 0xB0070001 bootImageSize: 0 bytes coresPresentMap: 0x00000000 enableDma: false scratchMemPtr: 00000000 socCoreOpMode: 43C27454 fxns: 43C26EE4 args: 43C27384 Core Presence Map Interpretation: --- Bootloader Configuration --- bootMedia: 0xB0070001 bootImageSize: 0 bytes coresPresentMap: 0x00000000 enableDma: false scratchMemPtr: 00000000 socCoreOpMode: 43C27454 fxns: 43C26EE4 args: 43C27384 Core Presence Map Interpretation: Multicore image size: 0 bytes Bootloader_Config *bootConfig; bootConfig->coresPresentMap = 0; Bootloader_parseMultiCoreAppImage Image loading status: -1 status = App_loadImages(bootHandle, &bootImageInfo); Error: Failed to load images (0xFFFFFFFF) if(App_OpenloadableImage(BOOTLOADER_SD_A53_APPIMAGE_FILENAME) == SystemP_SUCCESS) [BOOTLOADER_PROFILE] Boot Media : SD Card [BOOTLOADER_PROFILE] Boot Image Size : 0 KB [BOOTLOADER_PROFILE] Cores present : [BOOTLOADER PROFILE] System_init : 29388us [BOOTLOADER PROFILE] Drivers_open : 2909us [BOOTLOADER PROFILE] Board_driversOpen : 1464us [BOOTLOADER PROFILE] Sciclient Get Version : 10159us [BOOTLOADER_PROFILE] SBL Total Time Taken : 43921us Image loading done, switching to application ... Starting linux and RTOS/Baremetal applications Some tests have failed!!
/*
* Copyright (C) 2023 Texas Instruments Incorporated
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdlib.h>
#include <string.h>
#include "ti_drivers_config.h"
#include "ti_drivers_open_close.h"
#include "ti_board_open_close.h"
#include <drivers/device_manager/sciclient.h>
#include <drivers/bootloader.h>
#define BOOTLOADER_SD_MCU_R5_APPIMAGE_FILENAME ("/sd0/mcu_r5_image")
#define BOOTLOADER_SD_WKUP_APPIMAGE_FILENAME ("/sd0/wkup_r5_image")
#define BOOTLOADER_SD_A53_APPIMAGE_FILENAME ("/sd0/linux_a53_image")
#define BOOTLOADER_SD_APP_IMAGE_LOADED (1)
#define BOOTLOADER_SD_MAX_NO_OF_FILES (2)
#define BOOTLOADER_APPIMAGE_MAX_FILE_SIZE (0x2000000) /* Size of section DDR specified in linker.cmd */
uint8_t gAppimage[BOOTLOADER_APPIMAGE_MAX_FILE_SIZE] __attribute__((aligned(128), section(".bss.filebuf")));
uint8_t socCpuCores[CSL_CORE_ID_MAX] = {0};
Bootloader_CpuInfo bootCpuInfo[CSL_CORE_ID_MAX];
char* gBootLoaderSDFiles[BOOTLOADER_SD_MAX_NO_OF_FILES] =
{BOOTLOADER_SD_MCU_R5_APPIMAGE_FILENAME,
BOOTLOADER_SD_WKUP_APPIMAGE_FILENAME
};
char** pFiles = gBootLoaderSDFiles;
/* call this API to stop the booting process and spin, do that you can connect
* debugger, load symbols and then make the 'loop' variable as 0 to continue execution
* with debugger connected.
*/
void loop_forever()
{
volatile uint32_t loop = 1;
while(loop)
;
}
int App_OpenloadableImage(char* imageName)
{
int status = SystemP_SUCCESS;
/* File I/O */
/* Open app file */
FF_FILE *appFp = ff_fopen(imageName, "rb");
/* Check if file open succeeded */
if(appFp == NULL)
{
status = SystemP_FAILURE;
}
else
{
/* Check file size */
uint32_t fileSize = ff_filelength(appFp);
if(fileSize >= BOOTLOADER_APPIMAGE_MAX_FILE_SIZE)
{
/* Application size more than buffer size, abort */
status = SystemP_FAILURE;
DebugP_log("Appimage size exceeded limit !!\r\n");
}
else
{
/* Read the file into RAM buffer */
memset(gAppimage, 0x0, sizeof(gAppimage));
ff_fread(gAppimage, fileSize, 1, appFp);
}
/* Close the file */
ff_fclose(appFp);
}
return status;
}
int32_t App_loadImages(Bootloader_Handle bootHandle, Bootloader_BootImageInfo *bootImageInfo)
{
int32_t status = SystemP_FAILURE;
Bootloader_Config *bootConfig;
DebugP_log("Bootloader_Config *bootConfig;\r\n");
if(bootHandle != NULL)
{
bootConfig = (Bootloader_Config *)bootHandle;
bootConfig->coresPresentMap = 0;
DebugP_log("bootConfig->coresPresentMap = 0;\r\n");
status = Bootloader_parseMultiCoreAppImage(bootHandle, bootImageInfo);
DebugP_log("Bootloader_parseMultiCoreAppImage\r\n");
/* Load CPUs */
if((SystemP_SUCCESS == status) && (TRUE == Bootloader_isCorePresent(bootHandle, CSL_CORE_ID_MCU_R5FSS0_0)))
{
DebugP_log("(SystemP_SUCCESS == status) && (TRUE == Bootloader_isCorePresent(bootHandle, CSL_CORE_ID_MCU_R5FSS0_0)\r\n");
bootImageInfo->cpuInfo[CSL_CORE_ID_MCU_R5FSS0_0].clkHz = Bootloader_socCpuGetClkDefault(CSL_CORE_ID_MCU_R5FSS0_0);
Bootloader_profileAddCore(CSL_CORE_ID_MCU_R5FSS0_0);
status = Bootloader_loadCpu(bootHandle, &(bootImageInfo->cpuInfo[CSL_CORE_ID_MCU_R5FSS0_0]));
DebugP_log("Bootloader_loadCpu(bootHandle, &(bootImageInfo->cpuInfo[CSL_CORE_ID_MCU_R5FSS0_0]));\r\n");
socCpuCores[CSL_CORE_ID_MCU_R5FSS0_0] = BOOTLOADER_SD_APP_IMAGE_LOADED;
bootCpuInfo[CSL_CORE_ID_MCU_R5FSS0_0] = bootImageInfo->cpuInfo[CSL_CORE_ID_MCU_R5FSS0_0];
}
if((SystemP_SUCCESS == status) && (TRUE == Bootloader_isCorePresent(bootHandle, CSL_CORE_ID_WKUP_R5FSS0_0)))
{
bootImageInfo->cpuInfo[CSL_CORE_ID_WKUP_R5FSS0_0].clkHz = Bootloader_socCpuGetClkDefault(CSL_CORE_ID_WKUP_R5FSS0_0);
status = Bootloader_loadSelfCpu(bootHandle, &(bootImageInfo->cpuInfo[CSL_CORE_ID_WKUP_R5FSS0_0]));
DebugP_log("Bootloader_loadSelfCpu(bootHandle, &(bootImageInfo->cpuInfo[CSL_CORE_ID_WKUP_R5FSS0_0]));\r\n");
Bootloader_profileAddCore(CSL_CORE_ID_WKUP_R5FSS0_0);
Bootloader_profileAddProfilePoint("App_loadImages(CSL_CORE_ID_WKUP_R5FSS0_0)");
DebugP_log("Bootloader_profileAddProfilePoint(App_loadImages(CSL_CORE_ID_WKUP_R5FSS0_0));\r\n");
}
}
return status;
}
int32_t App_loadLinuxImages(Bootloader_Handle bootHandle, Bootloader_BootImageInfo *bootImageInfo)
{
int32_t status = SystemP_FAILURE;
Bootloader_Config *bootConfig;
if(bootHandle != NULL)
{
bootConfig = (Bootloader_Config *)bootHandle;
bootConfig->coresPresentMap = 0;
status = Bootloader_parseMultiCoreAppImage(bootHandle, bootImageInfo);
if((SystemP_SUCCESS == status) && (TRUE == Bootloader_isCorePresent(bootHandle, CSL_CORE_ID_A53SS0_0)))
{
bootImageInfo->cpuInfo[CSL_CORE_ID_A53SS0_0].clkHz = Bootloader_socCpuGetClkDefault(CSL_CORE_ID_A53SS0_0);
Bootloader_profileAddCore(CSL_CORE_ID_A53SS0_0);
status = Bootloader_loadCpu(bootHandle, &(bootImageInfo->cpuInfo[CSL_CORE_ID_A53SS0_0]));
socCpuCores[CSL_CORE_ID_A53SS0_0] = BOOTLOADER_SD_APP_IMAGE_LOADED;
bootCpuInfo[CSL_CORE_ID_A53SS0_0] = bootImageInfo->cpuInfo[CSL_CORE_ID_A53SS0_0];
}
}
return status;
}
int32_t App_runCpus(Bootloader_Handle bootHandle)
{
int32_t status = SystemP_FAILURE;
uint8_t cpuId;
for(cpuId = 0; cpuId < CSL_CORE_ID_MAX; cpuId++)
{
if(cpuId == CSL_CORE_ID_A53SS0_0)
{
continue;
}
if(socCpuCores[cpuId] == BOOTLOADER_SD_APP_IMAGE_LOADED)
{
status = Bootloader_runCpu(bootHandle, &bootCpuInfo[cpuId]);
}
}
return status;
}
int32_t App_runLinuxCpu(Bootloader_Handle bootHandle, Bootloader_BootImageInfo *bootImageInfo)
{
int32_t status = SystemP_FAILURE;
/* Unlock all the control MMRs. Linux/U-boot expects all the MMRs to be unlocked */
SOC_unlockAllMMR();
if(socCpuCores[CSL_CORE_ID_A53SS0_0] == BOOTLOADER_SD_APP_IMAGE_LOADED)
{
status = Bootloader_runCpu(bootHandle, &bootCpuInfo[CSL_CORE_ID_A53SS0_0]);
}
return status;
}
int main()
{
int32_t status;
uint32_t appImageSize = 0;
uint8_t noOfFiles = 0;
DebugP_log("11111111111111111\r\n");
Bootloader_profileReset();
Bootloader_socWaitForFWBoot();
status = Bootloader_socOpenFirewalls();
DebugP_assertNoLog(status == SystemP_SUCCESS);
DebugP_log("Bootloader_socOpenFirewalls()\r\n");
System_init();
Bootloader_profileAddProfilePoint("System_init");
Drivers_open();
Bootloader_profileAddProfilePoint("Drivers_open");
DebugP_log("Drivers_open()\r\n");
status = Board_driversOpen();
DebugP_assert(status == SystemP_SUCCESS);
Bootloader_profileAddProfilePoint("Board_driversOpen");
status = Sciclient_getVersionCheck(1);
Bootloader_profileAddProfilePoint("Sciclient Get Version");
DebugP_log("Sciclient_getVersionCheck(1)\r\n");
if(SystemP_SUCCESS == status)
{
Bootloader_BootImageInfo bootImageInfo;
Bootloader_Params bootParams;
Bootloader_Handle bootHandle;
Bootloader_BootImageInfo bootImageInfoLinux;
Bootloader_Params bootParamsLinux;
Bootloader_Handle bootHandleLinux;
DebugP_log("Bootloader_Handle bootHandleLinux\r\n");
Bootloader_Params_init(&bootParams);
DebugP_log("Bootloader_Params_init\r\n");
Bootloader_Params_init(&bootParamsLinux);
Bootloader_BootImageInfo_init(&bootImageInfo);
Bootloader_BootImageInfo_init(&bootImageInfoLinux);
DebugP_log("Bootloader_BootImageInfo_init(&bootImageInfoLinux);\r\n");
while(noOfFiles < BOOTLOADER_SD_MAX_NO_OF_FILES)
{
DebugP_log("noOfFiles < BOOTLOADER_SD_MAX_NO_OF_FILES\r\n");
Bootloader_Params_init(&bootParams);
Bootloader_BootImageInfo_init(&bootImageInfo);
bootParams.memArgsAppImageBaseAddr = (uintptr_t)gAppimage;
if(App_OpenloadableImage(pFiles[noOfFiles]) == SystemP_SUCCESS)
{
DebugP_log("pp_OpenloadableImage(pFiles[noOfFiles]) == SystemP_SUCCESS\r\n");
bootHandle = Bootloader_open(CONFIG_BOOTLOADER_APP, &bootParams);
DebugP_log("bootHandle = Bootloader_open(CONFIG_BOOTLOADER_APP, &bootParams);\r\n");
if(bootHandle != NULL)
{
DebugP_log("bootHandle != NULL \r\n");
appImageSize += Bootloader_getMulticoreImageSize(bootHandle);
//DebugP_log("%un\r\n",appImageSize);
DebugP_log("Multicore image size: %u bytes\r\n", appImageSize);
status = App_loadImages(bootHandle, &bootImageInfo);
//DebugP_log("%ld\r\n",status);
DebugP_log("Image loading status: %d\r\n", status); // Changed to %d for int32_t
DebugP_log("status = App_loadImages(bootHandle, &bootImageInfo);\r\n");
}
}
if(status == SystemP_SUCCESS)
{
noOfFiles++;
DebugP_log("noOfFiles++;\r\n");
}
else
{ DebugP_log("Error: Failed to load images (0x%08X)\r\n", status);
break;
}
}
bootParamsLinux.memArgsAppImageBaseAddr = (uintptr_t)gAppimage;
if(App_OpenloadableImage(BOOTLOADER_SD_A53_APPIMAGE_FILENAME) == SystemP_SUCCESS)
{
DebugP_log("if(App_OpenloadableImage(BOOTLOADER_SD_A53_APPIMAGE_FILENAME) == SystemP_SUCCESS)\r\n");
bootHandleLinux = Bootloader_open(CONFIG_BOOTLOADER_APP, &bootParamsLinux);
if(SystemP_SUCCESS == status)
{
if(bootHandleLinux != NULL)
{
appImageSize+=Bootloader_getMulticoreImageSize(bootHandleLinux);
status = App_loadLinuxImages(bootHandleLinux, &bootImageInfoLinux);
Bootloader_profileAddProfilePoint("App_loadLinuxImages");
}
}
}
/* Power off MMC 1 instance */
status = SOC_moduleClockEnable(TISCI_DEV_MMCSD1, 0);
Bootloader_profileUpdateAppimageSize(appImageSize);
Bootloader_profileUpdateMediaAndClk(BOOTLOADER_MEDIA_SD, 0);
if(SystemP_SUCCESS == status)
{
/* Print SBL log as Linux prints log to the same UART port */
Bootloader_profilePrintProfileLog();
DebugP_log("Image loading done, switching to application ...\r\n");
DebugP_log("Starting linux and RTOS/Baremetal applications\r\n");
UART_flushTxFifo(gUartHandle[CONFIG_UART0]);
}
if(SystemP_SUCCESS == status)
{
status = App_runLinuxCpu(bootHandleLinux, &bootImageInfoLinux);
Bootloader_close(bootHandleLinux);
}
if(SystemP_SUCCESS == status)
{
status = App_runCpus(bootHandle);
Bootloader_close(bootHandle);
}
}
if(status != SystemP_SUCCESS )
{
DebugP_log("Some tests have failed!!\r\n");
}
/* Call DPL deinit to close the tick timer and disable interrupts before jumping to DM*/
Dpl_deinit();
Bootloader_JumpSelfCpu();
DebugP_log("Bootloader_JumpSelfCpu();\r\n");
Drivers_close();
System_deinit();
return 0;
}
int32_t Bootloader_verifyMulticoreImage(Bootloader_Handle handle)
{
int32_t status = SystemP_SUCCESS, authStatus = SystemP_FAILURE;
uint32_t certLen = 0U, imageLen = 0U, ddrCopy = 1U;
uint32_t certLoadAddr = 0xFFFFFFFFU;
Bootloader_Config *config = (Bootloader_Config *)handle;
if (config->fxns->imgReadFxn == NULL || config->fxns->imgSeekFxn == NULL)
{
status = SystemP_FAILURE;
}
else
{
uint8_t x509Header[4];
if (config->bootMedia == BOOTLOADER_MEDIA_MEM)
{
Bootloader_MemArgs *memArgs = (Bootloader_MemArgs *)(config->args);
certLoadAddr = memArgs->appImageBaseAddr;
config->fxns->imgReadFxn(x509Header, 4, config->args);
config->fxns->imgSeekFxn(0, config->args);
certLen = Bootloader_getX509CertLen(x509Header);
imageLen = Bootloader_getMsgLen((uint8_t *)certLoadAddr, certLen);
/* Get the 128B cache-line aligned image length */
uint32_t cacheAlignedLen = (certLen + imageLen + (uint32_t)128) & ~(127);
/* Write back and invalidate the cache before passing to HSM */
CacheP_wbInv((void *)certLoadAddr, cacheAlignedLen, CacheP_TYPE_ALL);
}
else if (config->bootMedia == BOOTLOADER_MEDIA_FLASH || config->bootMedia == BOOTLOADER_MEDIA_EMMC)
{
config->fxns->imgReadFxn(x509Header, 4, config->args);
config->fxns->imgSeekFxn(0, config->args);
certLen = Bootloader_getX509CertLen(x509Header);
if (config->bootMedia == BOOTLOADER_MEDIA_FLASH)
{
Bootloader_FlashArgs *flashArgs = (Bootloader_FlashArgs *)(config->args);
if (flashArgs->flashType == CONFIG_FLASH_TYPE_SERIAL_NOR)
{
ddrCopy = 0;
certLoadAddr = FLASH_BASE_ADDRESS + flashArgs->appImageOffset;
imageLen = Bootloader_getMsgLen((uint8_t *)(certLoadAddr), certLen);
/* Invalidate 128B cache-line aligned destination region before TIFS writes to it */
CacheP_inv((void *)config->scratchMemPtr, (imageLen + (uint32_t)128) & ~(127), CacheP_TYPE_ALL);
/* Enable OSPI Phy if configured to do so*/
flashArgs->enablePhyPipeline = TRUE;
status = config->fxns->imgCustomFxn(config->args);
}
else
{
certLoadAddr = flashArgs->appImageOffset;
}
}
#if defined(DRV_VERSION_MMCSD_V0) || defined(DRV_VERSION_MMCSD_V1)
if (config->bootMedia == BOOTLOADER_MEDIA_EMMC)
{
Bootloader_MmcsdArgs *mmcsdArgs = (Bootloader_MmcsdArgs *)(config->args);
certLoadAddr = mmcsdArgs->appImageOffset;
}
#endif
if (config->scratchMemPtr != NULL && ddrCopy == 1U)
{
config->fxns->imgReadFxn((void *)config->scratchMemPtr, 0x800, config->args);
imageLen = Bootloader_getMsgLen((uint8_t *)config->scratchMemPtr, certLen);
uint32_t totalLen = (certLen + imageLen + (uint32_t)128) & ~(127);
config->fxns->imgSeekFxn(0, config->args);
config->fxns->imgReadFxn((void *)config->scratchMemPtr, totalLen, config->args);
certLoadAddr = (uint32_t)(&(config->scratchMemPtr[0]));
config->fxns->imgSeekFxn(0, config->args);
/* Get the 128B cache-line aligned image length */
uint32_t cacheAlignedLen = (certLen + imageLen + (uint32_t)128) & ~(127);
/* Write back and invalidate the cache before passing to HSM */
CacheP_wbInv((void *)certLoadAddr, cacheAlignedLen, CacheP_TYPE_ALL);
}
}
DebugP_log(" before Check if the certificate length is within valid range \r\n");
/* Check if the certificate length is within valid range */
if ((certLen > (uint32_t)0x100) && (certLen < (uint32_t)0x800) && status == SystemP_SUCCESS)
{
DebugP_log(" after Check if the certificate length is within valid range \r\n");
authStatus = Bootloader_socAuthImage(certLoadAddr);
DebugP_log(" after Bootloader_socAuthImage(certLoadAddr);\r\n");
if (config->bootMedia == BOOTLOADER_MEDIA_BUFIO)
{
/* Authentication will fail in Buf Io because we don't have full data yet, so make it pass here for testing. Default behaviour is to assert. */
/* authStatus = SystemP_SUCCESS; */
DebugP_assertNoLog(authStatus == SystemP_SUCCESS);
}
if (authStatus == SystemP_FAILURE)
{
DebugP_logError("Failed to authenticate Image\r\n");
status = SystemP_FAILURE;
}
else
{
/* Authentication passed, all good. Now re-init bootloader params to point to image start instead of start of x509 certificate */
if (config->bootMedia == BOOTLOADER_MEDIA_FLASH)
{
Bootloader_FlashArgs *flashArgs = (Bootloader_FlashArgs *)(config->args);
flashArgs->curOffset = flashArgs->appImageOffset;
if (flashArgs->flashType == CONFIG_FLASH_TYPE_SERIAL_NOR)
{
/* Disable only the PHY pipeline*/
flashArgs->enablePhyPipeline = FALSE;
status = config->fxns->imgCustomFxn(config->args);
}
}
else if (config->bootMedia == BOOTLOADER_MEDIA_BUFIO)
{
Bootloader_BufIoArgs *bufIoArgs = (Bootloader_BufIoArgs *)(config->args);
bufIoArgs->curOffset = bufIoArgs->appImageOffset;
}
#if defined(DRV_VERSION_MMCSD_V0) || defined(DRV_VERSION_MMCSD_V1)
else if (config->bootMedia == BOOTLOADER_MEDIA_EMMC)
{
Bootloader_MmcsdArgs *mmcsdArgs = (Bootloader_MmcsdArgs *)(config->args);
mmcsdArgs->curOffset = mmcsdArgs->appImageOffset;
}
#endif
}
}
else
{
status = SystemP_FAILURE;
}
}
return status;
}
int32_t Bootloader_socAuthImage(uint32_t certLoadAddr)
{
int32_t status = SystemP_FAILURE;
struct tisci_msg_proc_auth_boot_req authReq;
DebugP_log(" struct tisci_msg_proc_auth_boot_req authReq;\r\n");
/* Request TIFS (SYSFW) to authenticate (and decrypt if mentioned in the x509 cert) the image */
authReq.certificate_address_hi = 0U;
authReq.certificate_address_lo = certLoadAddr;
status = Sciclient_procBootAuthAndStart(&authReq, SystemP_WAIT_FOREVER);
DebugP_log(" Sciclient_procBootAuthAndStart(&authReq, SystemP_WAIT_FOREVER);%d\r\n", status);
return status;
}
SYSFW Firmware Version 10.0.8--v10.00.08 (Fiery Fox) SYSFW Firmware revision 0xa SYSFW ABI revision 4.0 Sciclient_getVersionCheck(1) Bootloader_Handle bootHandleLinux Bootloader_Params_init Bootloader_BootImageInfo_init(&bootImageInfoLinux); noOfFiles < BOOTLOADER_SD_MAX_NO_OF_FILES pp_OpenloadableImage(pFiles[noOfFiles]) == SystemP_SUCCESS bootHandle = Bootloader_open(CONFIG_BOOTLOADER_APP, &bootParams); bootHandle != NULL in Bootloader_getMulticoreImageSize --- Bootloader Configuration --- bootMedia: 0xB0070001 bootImageSize: 0 bytes coresPresentMap: 0x00000000 enableDma: false scratchMemPtr: 00000000 socCoreOpMode: 43C274D4 fxns: 43C26F64 args: 43C27404 Core Presence Map Interpretation: --- Bootloader Configuration --- bootMedia: 0xB0070001 bootImageSize: 0 bytes coresPresentMap: 0x00000000 enableDma: false scratchMemPtr: 00000000 socCoreOpMode: 43C274D4 fxns: 43C26F64 args: 43C27404 Core Presence Map Interpretation: Multicore image size: 0 bytes Bootloader_Config *bootConfig; bootConfig->coresPresentMap = 0; before Check if the certificate length is within valid range Bootloader_parseMultiCoreAppImage Image loading status: -1 status = App_loadImages(bootHandle, &bootImageInfo); Error: Failed to load images (0xFFFFFFFF) if(App_OpenloadableImage(BOOTLOADER_SD_A53_APPIMAGE_FILENAME) == SystemP_SUCCESS) [BOOTLOADER_PROFILE] Boot Media : SD Card [BOOTLOADER_PROFILE] Boot Image Size : 0 KB [BOOTLOADER_PROFILE] Cores present : [BOOTLOADER PROFILE] System_init : 29533us [BOOTLOADER PROFILE] Drivers_open : 2879us [BOOTLOADER PROFILE] Board_driversOpen : 1464us [BOOTLOADER PROFILE] Sciclient Get Version : 10169us [BOOTLOADER_PROFILE] SBL Total Time Taken : 44048us Image loading done, switching to application ... Starting linux and RTOS/Baremetal applications
It seems that it never enter Bootloader_socAuthImage function.
Here is my .mak file. I only change this for signing .
# Device type (HS/GP)
DEVICE_TYPE?=HS
VERSION?=1.5
# Path to the signing tools, keys etc
SIGNING_TOOL_PATH=$(MCU_PLUS_SDK_PATH)/tools/boot/signing
# Path to the keys
ROM_DEGENERATE_KEY:=$(SIGNING_TOOL_PATH)/rom_degenerateKey.pem
APP_DEGENERATE_KEY:=$(SIGNING_TOOL_PATH)/app_degenerateKey.pem
ifeq ($(DEVICE),am263x)
CUST_MPK=$(SIGNING_TOOL_PATH)/mcu_custMpk.pem
else ifeq ($(DEVICE),am273x)
CUST_MPK=$(SIGNING_TOOL_PATH)/mcu_custMpk.pem
else ifeq ($(DEVICE),awr294x)
CUST_MPK=$(SIGNING_TOOL_PATH)/mcu_custMpk.pem
else ifeq ($(DEVICE),am62x)
CUST_MPK=$(SIGNING_TOOL_PATH)/custMpk_am62x.pem
CUST_MEK=$(SIGNING_TOOL_PATH)/custMek_am62x.txt
else ifeq ($(DEVICE),am62ax)
CUST_MPK=$(SIGNING_TOOL_PATH)/custMpk_am62ax.pem
CUST_MEK=$(SIGNING_TOOL_PATH)/custMek_am62ax.txt
else ifeq ($(DEVICE),am62dx)
CUST_MPK=$(SIGNING_TOOL_PATH)/custMpk_am62dx.pem
CUST_MEK=$(SIGNING_TOOL_PATH)/custMek_am62dx.txt
else ifeq ($(DEVICE),am62px)
CUST_MPK=$(SIGNING_TOOL_PATH)/custMpk_am62px.pem
CUST_MEK=$(SIGNING_TOOL_PATH)/custMek_am62px.txt
else
CUST_MPK=$(SIGNING_TOOL_PATH)/custMpk_am64x_am243x.pem
CUST_MEK=$(SIGNING_TOOL_PATH)/custMek_am64x_am243x.txt
endif
# Encryption option for application (yes/no)
ENC_ENABLED?=yes
# Encryption option for SBL (yes/no)
ENC_SBL_ENABLED?=yes
# Debug option for HS (yes/no)
DBG_ENABLED?=no
# Generic macros to be used depending on the device type
APP_SIGNING_KEY=
APP_ENCRYPTION_KEY=
ifeq ($(DEVICE_TYPE),HS)
APP_SIGNING_KEY=$(CUST_MPK)
APP_ENCRYPTION_KEY=$(CUST_MEK)
else
APP_SIGNING_KEY=$(APP_DEGENERATE_KEY)
endif
ti/mcu_plus_sdk_am62px_10_00_00_14$ make clean PROFILE=debug
ti/mcu_plus_sdk_am62px_10_00_00_14$ make PROFILE=debug
Then I run these two command.
Drivers_open() SYSFW Firmware Version 10.0.8--v10.00.08 (Fiery Fox) SYSFW Firmware revision 0xa SYSFW ABI revision 4.0 Sciclient_getVersionCheck(1) Bootloader_Handle bootHandleLinux Bootloader_Params_init Bootloader_BootImageInfo_init(&bootImageInfoLinux); noOfFiles < BOOTLOADER_SD_MAX_NO_OF_FILES pp_OpenloadableImage(pFiles[noOfFiles]) == SystemP_SUCCESS bootHandle = Bootloader_open(CONFIG_BOOTLOADER_APP, &bootParams); bootHandle != NULL in Bootloader_getMulticoreImageSize --- Bootloader Configuration --- bootMedia: 0xB0070001 bootImageSize: 0 bytes coresPresentMap: 0x00000000 enableDma: false scratchMemPtr: 00000000 socCoreOpMode: 43C274D4 fxns: 43C26F64 args: 43C27404 Core Presence Map Interpretation: --- Bootloader Configuration --- bootMedia: 0xB0070001 bootImageSize: 0 bytes coresPresentMap: 0x00000000 enableDma: false scratchMemPtr: 00000000 socCoreOpMode: 43C274D4 fxns: 43C26F64 args: 43C27404 Core Presence Map Interpretation: Multicore image size: 0 bytes Bootloader_Config *bootConfig; bootConfig->coresPresentMap = 0; before Check if the certificate length is within valid range after Check if the certificate length is within valid range struct tisci_msg_proc_auth_boot_req authReq;
This is the same SD card output in the TI official board.
Drivers_open() SYSFW Firmware Version 10.0.8--v10.00.08 (Fiery Fox) SYSFW Firmware revision 0xa SYSFW ABI revision 4.0 Sciclient_getVersionCheck(1) Bootloader_Handle bootHandleLinux Bootloader_Params_init Bootloader_BootImageInfo_init(&bootImageInfoLinux); noOfFiles < BOOTLOADER_SD_MAX_NO_OF_FILES pp_OpenloadableImage(pFiles[noOfFiles]) == SystemP_SUCCESS bootHandle = Bootloader_open(CONFIG_BOOTLOADER_APP, &bootParams); bootHandle != NULL in Bootloader_getMulticoreImageSize --- Bootloader Configuration --- bootMedia: 0xB0070001 bootImageSize: 0 bytes coresPresentMap: 0x00000000 enableDma: false scratchMemPtr: 00000000 socCoreOpMode: 43C274D4 fxns: 43C26F64 args: 43C27404 Core Presence Map Interpretation: --- Bootloader Configuration --- bootMedia: 0xB0070001 bootImageSize: 0 bytes coresPresentMap: 0x00000000 enableDma: false scratchMemPtr: 00000000 socCoreOpMode: 43C274D4 fxns: 43C26F64 args: 43C27404 Core Presence Map Interpretation: Multicore image size: 0 bytes Bootloader_Config *bootConfig; bootConfig->coresPresentMap = 0; before Check if the certificate length is within valid range after Check if the certificate length is within valid range struct tisci_msg_proc_auth_boot_req authReq; Sciclient_procBootAuthAndStart(&authReq, SystemP_WAIT_FOREVER);0 after Bootloader_socAuthImage(certLoadAddr); Bootloader_parseMultiCoreAppImage (SystemP_SUCCESS == status) && (TRUE == Bootloader_isCorePresent(bootHandle, CSL_CORE_ID_MCU_R5FSS0_0) Bootloader_loadCpu(bootHandle, &(bootImageInfo->cpuInfo[CSL_CORE_ID_MCU_R5FSS0_0])); Image loading status: 0 status = App_loadImages(bootHandle, &bootImageInfo); noOfFiles++; noOfFiles < BOOTLOADER_SD_MAX_NO_OF_FILES pp_OpenloadableImage(pFiles[noOfFiles]) == SystemP_SUCCESS bootHandle = Bootloader_open(CONFIG_BOOTLOADER_APP, &bootParams); bootHandle != NULL in Bootloader_getMulticoreImageSize --- Bootloader Configuration --- bootMedia: 0xB0070001 bootImageSize: 26600 bytes coresPresentMap: 0x00000001 enableDma: false scratchMemPtr: 00000000 socCoreOpMode: 43C274D4 fxns: 43C26F64 args: 43C27404 Core Presence Map Interpretation: Core 0: Present --- Bootloader Configuration --- bootMedia: 0xB0070001 bootImageSize: 26600 bytes coresPresentMap: 0x00000001 enableDma: false scratchMemPtr: 00000000 socCoreOpMode: 43C274D4 fxns: 43C26F64 args: 43C27404 Core Presence Map Interpretation: Core 0: Present Multicore image size: 26600 bytes Bootloader_Config *bootConfig; bootConfig->coresPresentMap = 0; before Check if the certificate length is within valid range after Check if the certificate length is within valid range struct tisci_msg_proc_auth_boot_req authReq; Sciclient_procBootAuthAndStart(&authReq, SystemP_WAIT_FOREVER);0 after Bootloader_socAuthImage(certLoadAddr); Bootloader_parseMultiCoreAppImage Bootloader_loadSelfCpu(bootHandle, &(bootImageInfo->cpuInfo[CSL_CORE_ID_WKUP_R5FSS0_0])); Bootloader_profileAddProfilePoint(App_loadImages(CSL_CORE_ID_WKUP_R5FSS0_0)); Image loading status: 0 status = App_loadImages(bootHandle, &bootImageInfo); noOfFiles++; if(App_OpenloadableImage(BOOTLOADER_SD_A53_APPIMAGE_FILENAME) == SystemP_SUCCESS) in Bootloader_getMulticoreImageSize --- Bootloader Configuration --- bootMedia: 0xB0070001 bootImageSize: 179076 bytes coresPresentMap: 0x00000002 enableDma: false scratchMemPtr: 00000000 socCoreOpMode: 43C274D4 fxns: 43C26F64 args: 43C27404 Core Presence Map Interpretation: Core 1: Present --- Bootloader Configuration --- bootMedia: 0xB0070001 bootImageSize: 179076 bytes coresPresentMap: 0x00000002 enableDma: false scratchMemPtr: 00000000 socCoreOpMode: 43C274D4 fxns: 43C26F64 args: 43C27404 Core Presence Map Interpretation: Core 1: Present before Check if the certificate length is within valid range after Check if the certificate length is within valid range struct tisci_msg_proc_auth_boot_req authReq; Sciclient_procBootAuthAndStart(&authReq, SystemP_WAIT_FOREVER);0 after Bootloader_socAuthImage(certLoadAddr); status = Bootloader_parseMultiCoreAppImage(bootHandle, bootImageInfo); bootImageInfo->cpuInfo[CSL_CORE_ID_A53SS0_0].clkHz = Bootloader_socCpuGetClkDefault(CSL_CORE_ID_A53SS0_0); Bootloader_loadCpu(bootHandle, &(bootImageInfo->cpuInfo[CSL_CORE_ID_A53SS0_0]));0 [BOOTLOADER_PROFILE] Boot Media : SD Card [BOOTLOADER_PROFILE] Boot Image Size : 200 KB [BOOTLOADER_PROFILE] Cores present : mcu-r5f0-0 wkup-r5f0-0 a530-0 [BOOTLOADER PROFILE] System_init : 39303us [BOOTLOADER PROFILE] Drivers_open : 2878us [BOOTLOADER PROFILE] Board_driversOpen : 1463us [BOOTLOADER PROFILE] Sciclient Get Version : 10171us [BOOTLOADER PROFILE] App_loadImages(CSL_CORE_ID_WKUP_R5FSS0_0) : 808256us [BOOTLOADER PROFILE] App_loadLinuxImages : 486337us [BOOTLOADER_PROFILE] SBL Total Time Taken : 1348410us Image loading done, switching to application ... Starting linux and RTOS/Baremetal applications NOTICE: BL31: v2.10.0(release):v2.10.0-367-g00f1ec6b87-dirty NOTICE: BL31: Built : 16:09:05, Feb 9 2024 U-Boot SPL 2024.04-ti-gfda88f8bcea3 (Jul 26 2024 - 11:00:12 +0000) SYSFW ABI: 4.0 (firmware rev 0x000a '10.0.8--v10.00.08 (Fiery Fox)') SPL initial stack usage: 1904 bytes Trying to boot from MMC2 Authentication passed Authentication passed U-Boot 2024.04-ti-gfda88f8bcea3 (Jul 26 2024 - 11:00:12 +0000) SoC: AM62PX SR1.0 HS-SE Model: Texas Instruments AM62P5 SK DRAM: 2 GiB (effective 8 GiB) Core: 84 devices, 30 uclasses, devicetree: separate MMC: mmc@fa10000: 0, mmc@fa00000: 1 Loading Environment from nowhere... OK In: serial Out: serial Err: serial Net: eth0: ethernet@8000000port@1 Warning: ethernet@8000000port@2 (eth1) using random MAC address - 12:72:1b:e2:9d:75 , eth1: ethernet@8000000port@2 Hit any key to stop autoboot: 0 switch to partitions #0, OK mmc1 is current device SD/MMC found on device 1 Failed to load 'uEnv.txt' Failed to load '/boot/fitImage' Wrong Image Type for bootm command ERROR -91: can't get kernel image! Scanning for bootflows in all bootdevs Seq Method State Uclass Part Name Filename --- ----------- ------ -------- ---- ------------------------ ---------------- Scanning global bootmeth 'efi_mgr': No EFI system partition No EFI system partition Failed to persist EFI variables No EFI system partition Failed to persist EFI variables No EFI system partition Failed to persist EFI variables No EFI system partition Failed to persist EFI variables No EFI system partition Failed to persist EFI variables 0 efi_mgr ready (none) 0 <NULL> ** Booting bootflow '<NULL>' with efi_mgr Loading Boot0000 'mmc 1' failed Loading Boot0001 'mmc 0' failed EFI boot manager: Cannot load any image Boot failed (err=-14) Scanning bootdev 'mmc@fa00000.bootdev': Scanning bootdev 'mmc@fa10000.bootdev': Bus usb@31100000: Register 1000840 NbrPorts 1 Starting the controller USB XHCI 1.10 scanning bus usb@31100000 for devices... 1 USB Device(s) found ethernet@8000000port@1 Waiting for PHY auto negotiation to complete......... TIMEOUT ! am65_cpsw_nuss_port ethernet@8000000port@1: phy_startup failed am65_cpsw_nuss_port ethernet@8000000port@1: am65_cpsw_start end error ethernet@8000000port@2 Waiting for PHY auto negotiation to complete......... TIMEOUT ! am65_cpsw_nuss_port ethernet@8000000port@2: phy_startup failed am65_cpsw_nuss_port ethernet@8000000port@2: am65_cpsw_start end error ethernet@8000000port@1 Waiting for PHY auto negotiation to complete......... TIMEOUT ! am65_cpsw_nuss_port ethernet@8000000port@1: phy_startup failed am65_cpsw_nuss_port ethernet@8000000port@1: am65_cpsw_start end error ethernet@8000000port@2 Waiting for PHY auto negotiation to complete......... TIMEOUT ! am65_cpsw_nuss_port ethernet@8000000port@2: phy_startup failed am65_cpsw_nuss_port ethernet@8000000port@2: am65_cpsw_start end error No more bootdevs --- ----------- ------ -------- ---- ------------------------ ---------------- (1 bootflow, 1 valid) =>
I use the images you gave me and u-boot.img in /mcu_plus_sdk_am62px_10_00_00_14/tools/boot/linuxAppimageGen/board/am62px-s. I get the above output.
So,I think it's time to make sure if I build the images correctly. Can you help me check my .mak file(in our previous conversation) and comman I used.
ti/mcu_plus_sdk_am62px_10_00_00_14$ make clean PROFILE=debug
ti/mcu_plus_sdk_am62px_10_00_00_14$ make PROFILE=debug
The images I shared were built with the same mak configuration except the "ENC_ENABLED" was set to NO. Can you try the same as well?
If your images still do not boot, please share them for me to evaluate the differences.
I followed your advice and change ENC_ENABLED to no.And it can boot as same as the image you gave me.
now I want to find out why the same boot SD CARD appear differently in my customer board and ti official board.
Drivers_open() SYSFW Firmware Version 10.0.8--v10.00.08 (Fiery Fox) SYSFW Firmware revision 0xa SYSFW ABI revision 4.0 Sciclient_getVersionCheck(1) Bootloader_Handle bootHandleLinux Bootloader_Params_init Bootloader_BootImageInfo_init(&bootImageInfoLinux); noOfFiles < BOOTLOADER_SD_MAX_NO_OF_FILES pp_OpenloadableImage(pFiles[noOfFiles]) == SystemP_SUCCESS bootHandle = Bootloader_open(CONFIG_BOOTLOADER_APP, &bootParams); bootHandle != NULL in Bootloader_getMulticoreImageSize --- Bootloader Configuration --- bootMedia: 0xB0070001 bootImageSize: 0 bytes coresPresentMap: 0x00000000 enableDma: false scratchMemPtr: 00000000 socCoreOpMode: 43C274D4 fxns: 43C26F64 args: 43C27404 Core Presence Map Interpretation: --- Bootloader Configuration --- bootMedia: 0xB0070001 bootImageSize: 0 bytes coresPresentMap: 0x00000000 enableDma: false scratchMemPtr: 00000000 socCoreOpMode: 43C274D4 fxns: 43C26F64 args: 43C27404 Core Presence Map Interpretation: Multicore image size: 0 bytes Bootloader_Config *bootConfig; bootConfig->coresPresentMap = 0; before Check if the certificate length is within valid range Bootloader_parseMultiCoreAppImage Image loading status: -1 status = App_loadImages(bootHandle, &bootImageInfo); Error: Failed to load images (0xFFFFFFFF) if(App_OpenloadableImage(BOOTLOADER_SD_A53_APPIMAGE_FILENAME) == SystemP_SUCCESS) [BOOTLOADER_PROFILE] Boot Media : SD Card [BOOTLOADER_PROFILE] Boot Image Size : 0 KB [BOOTLOADER_PROFILE] Cores present : [BOOTLOADER PROFILE] System_init : 29424us [BOOTLOADER PROFILE] Drivers_open : 2879us [BOOTLOADER PROFILE] Board_driversOpen : 1465us [BOOTLOADER PROFILE] Sciclient Get Version : 10169us [BOOTLOADER_PROFILE] SBL Total Time Taken : 43938us Image loading done, switching to application ... Starting linux and RTOS/Baremetal applications Some tests have failed!!
Drivers_open() SYSFW Firmware Version 10.0.8--v10.00.08 (Fiery Fox) SYSFW Firmware revision 0xa SYSFW ABI revision 4.0 Sciclient_getVersionCheck(1) Bootloader_Handle bootHandleLinux Bootloader_Params_init Bootloader_BootImageInfo_init(&bootImageInfoLinux); noOfFiles < BOOTLOADER_SD_MAX_NO_OF_FILES pp_OpenloadableImage(pFiles[noOfFiles]) == SystemP_SUCCESS bootHandle = Bootloader_open(CONFIG_BOOTLOADER_APP, &bootParams); bootHandle != NULL in Bootloader_getMulticoreImageSize --- Bootloader Configuration --- bootMedia: 0xB0070001 bootImageSize: 0 bytes coresPresentMap: 0x00000000 enableDma: false scratchMemPtr: 00000000 socCoreOpMode: 43C274D4 fxns: 43C26F64 args: 43C27404 Core Presence Map Interpretation: --- Bootloader Configuration --- bootMedia: 0xB0070001 bootImageSize: 0 bytes coresPresentMap: 0x00000000 enableDma: false scratchMemPtr: 00000000 socCoreOpMode: 43C274D4 fxns: 43C26F64 args: 43C27404 Core Presence Map Interpretation: Multicore image size: 0 bytes Bootloader_Config *bootConfig; bootConfig->coresPresentMap = 0; before Check if the certificate length is within valid range after Check if the certificate length is within valid range struct tisci_msg_proc_auth_boot_req authReq; Sciclient_procBootAuthAndStart(&authReq, SystemP_WAIT_FOREVER);0 after Bootloader_socAuthImage(certLoadAddr); Bootloader_parseMultiCoreAppImage (SystemP_SUCCESS == status) && (TRUE == Bootloader_isCorePresent(bootHandle, CSL_CORE_ID_MCU_R5FSS0_0) Bootloader_loadCpu(bootHandle, &(bootImageInfo->cpuInfo[CSL_CORE_ID_MCU_R5FSS0_0])); Image loading status: 0 status = App_loadImages(bootHandle, &bootImageInfo); noOfFiles++; noOfFiles < BOOTLOADER_SD_MAX_NO_OF_FILES pp_OpenloadableImage(pFiles[noOfFiles]) == SystemP_SUCCESS bootHandle = Bootloader_open(CONFIG_BOOTLOADER_APP, &bootParams); bootHandle != NULL in Bootloader_getMulticoreImageSize --- Bootloader Configuration --- bootMedia: 0xB0070001 bootImageSize: 26600 bytes coresPresentMap: 0x00000001 enableDma: false scratchMemPtr: 00000000 socCoreOpMode: 43C274D4 fxns: 43C26F64 args: 43C27404 Core Presence Map Interpretation: Core 0: Present --- Bootloader Configuration --- bootMedia: 0xB0070001 bootImageSize: 26600 bytes coresPresentMap: 0x00000001 enableDma: false scratchMemPtr: 00000000 socCoreOpMode: 43C274D4 fxns: 43C26F64 args: 43C27404 Core Presence Map Interpretation: Core 0: Present Multicore image size: 26600 bytes Bootloader_Config *bootConfig; bootConfig->coresPresentMap = 0; before Check if the certificate length is within valid range after Check if the certificate length is within valid range struct tisci_msg_proc_auth_boot_req authReq; Sciclient_procBootAuthAndStart(&authReq, SystemP_WAIT_FOREVER);0 after Bootloader_socAuthImage(certLoadAddr); Bootloader_parseMultiCoreAppImage Bootloader_loadSelfCpu(bootHandle, &(bootImageInfo->cpuInfo[CSL_CORE_ID_WKUP_R5FSS0_0])); Bootloader_profileAddProfilePoint(App_loadImages(CSL_CORE_ID_WKUP_R5FSS0_0)); Image loading status: 0 status = App_loadImages(bootHandle, &bootImageInfo); noOfFiles++; if(App_OpenloadableImage(BOOTLOADER_SD_A53_APPIMAGE_FILENAME) == SystemP_SUCCESS) in Bootloader_getMulticoreImageSize --- Bootloader Configuration --- bootMedia: 0xB0070001 bootImageSize: 179076 bytes coresPresentMap: 0x00000002 enableDma: false scratchMemPtr: 00000000 socCoreOpMode: 43C274D4 fxns: 43C26F64 args: 43C27404 Core Presence Map Interpretation: Core 1: Present --- Bootloader Configuration --- bootMedia: 0xB0070001 bootImageSize: 179076 bytes coresPresentMap: 0x00000002 enableDma: false scratchMemPtr: 00000000 socCoreOpMode: 43C274D4 fxns: 43C26F64 args: 43C27404 Core Presence Map Interpretation: Core 1: Present before Check if the certificate length is within valid range after Check if the certificate length is within valid range struct tisci_msg_proc_auth_boot_req authReq; Sciclient_procBootAuthAndStart(&authReq, SystemP_WAIT_FOREVER);0 after Bootloader_socAuthImage(certLoadAddr); status = Bootloader_parseMultiCoreAppImage(bootHandle, bootImageInfo); bootImageInfo->cpuInfo[CSL_CORE_ID_A53SS0_0].clkHz = Bootloader_socCpuGetClkDefault(CSL_CORE_ID_A53SS0_0); Bootloader_loadCpu(bootHandle, &(bootImageInfo->cpuInfo[CSL_CORE_ID_A53SS0_0]));0 [BOOTLOADER_PROFILE] Boot Media : SD Card [BOOTLOADER_PROFILE] Boot Image Size : 200 KB [BOOTLOADER_PROFILE] Cores present : mcu-r5f0-0 wkup-r5f0-0 a530-0 [BOOTLOADER PROFILE] System_init : 39303us [BOOTLOADER PROFILE] Drivers_open : 2878us [BOOTLOADER PROFILE] Board_driversOpen : 1463us [BOOTLOADER PROFILE] Sciclient Get Version : 10171us [BOOTLOADER PROFILE] App_loadImages(CSL_CORE_ID_WKUP_R5FSS0_0) : 808256us [BOOTLOADER PROFILE] App_loadLinuxImages : 486337us [BOOTLOADER_PROFILE] SBL Total Time Taken : 1348410us Image loading done, switching to application ... Starting linux and RTOS/Baremetal applications NOTICE: BL31: v2.10.0(release):v2.10.0-367-g00f1ec6b87-dirty NOTICE: BL31: Built : 16:09:05, Feb 9 2024 U-Boot SPL 2024.04-ti-gfda88f8bcea3 (Jul 26 2024 - 11:00:12 +0000) SYSFW ABI: 4.0 (firmware rev 0x000a '10.0.8--v10.00.08 (Fiery Fox)') SPL initial stack usage: 1904 bytes Trying to boot from MMC2 Authentication passed Authentication passed U-Boot 2024.04-ti-gfda88f8bcea3 (Jul 26 2024 - 11:00:12 +0000) SoC: AM62PX SR1.0 HS-SE Model: Texas Instruments AM62P5 SK DRAM: 2 GiB (effective 8 GiB) Core: 84 devices, 30 uclasses, devicetree: separate MMC: mmc@fa10000: 0, mmc@fa00000: 1 Loading Environment from nowhere... OK In: serial Out: serial Err: serial Net: eth0: ethernet@8000000port@1 Warning: ethernet@8000000port@2 (eth1) using random MAC address - 12:72:1b:e2:9d:75 , eth1: ethernet@8000000port@2 Hit any key to stop autoboot: 0 switch to partitions #0, OK mmc1 is current device SD/MMC found on device 1 Failed to load 'uEnv.txt' Failed to load '/boot/fitImage' Wrong Image Type for bootm command ERROR -91: can't get kernel image! Scanning for bootflows in all bootdevs Seq Method State Uclass Part Name Filename --- ----------- ------ -------- ---- ------------------------ ---------------- Scanning global bootmeth 'efi_mgr': No EFI system partition No EFI system partition Failed to persist EFI variables No EFI system partition Failed to persist EFI variables No EFI system partition Failed to persist EFI variables No EFI system partition Failed to persist EFI variables No EFI system partition Failed to persist EFI variables 0 efi_mgr ready (none) 0 <NULL> ** Booting bootflow '<NULL>' with efi_mgr Loading Boot0000 'mmc 1' failed Loading Boot0001 'mmc 0' failed EFI boot manager: Cannot load any image Boot failed (err=-14) Scanning bootdev 'mmc@fa00000.bootdev': Scanning bootdev 'mmc@fa10000.bootdev': Bus usb@31100000: Register 1000840 NbrPorts 1 Starting the controller USB XHCI 1.10 scanning bus usb@31100000 for devices... 1 USB Device(s) found ethernet@8000000port@1 Waiting for PHY auto negotiation to complete......... TIMEOUT ! am65_cpsw_nuss_port ethernet@8000000port@1: phy_startup failed am65_cpsw_nuss_port ethernet@8000000port@1: am65_cpsw_start end error ethernet@8000000port@2 Waiting for PHY auto negotiation to complete......... TIMEOUT ! am65_cpsw_nuss_port ethernet@8000000port@2: phy_startup failed am65_cpsw_nuss_port ethernet@8000000port@2: am65_cpsw_start end error ethernet@8000000port@1 Waiting for PHY auto negotiation to complete......... TIMEOUT ! am65_cpsw_nuss_port ethernet@8000000port@1: phy_startup failed am65_cpsw_nuss_port ethernet@8000000port@1: am65_cpsw_start end error ethernet@8000000port@2 Waiting for PHY auto negotiation to complete......... TIMEOUT ! am65_cpsw_nuss_port ethernet@8000000port@2: phy_startup failed am65_cpsw_nuss_port ethernet@8000000port@2: am65_cpsw_start end error No more bootdevs
The first file is the output of my customer board, which seems not to boot successfully. The second one is the official Ti board, which seems to boot in HS mode already. I am using the same SD card. Also both are using TI public key. Can you tell me what is the possible reason for this?
Thank you for your support.
Best Regards, KONG XIANGXU
now I want to find out why the same boot SD CARD appear differently in my customer board and ti official board.
I did not get this.
You said after setting the ENC_ENABLED to NO, the images built by you are booting successfully. Then, with what configuration you are still seeing failure on your custom board?
yes, both the image you gave me and I rebuild after ENC_ENABLED to no can boot on TI 's official board.But both failed on my customer board in the same way.
yes, both the image you gave me and I rebuild after ENC_ENABLED to no can boot on TI 's official board.But both failed on my customer board in the same way.
Understood.
Assuming you are using custom DDR part on your custom board, have you modified the DDR config file in the SBL SD bootloader:
software-dl.ti.com/.../DRIVERS_DDR_PAGE.html
U-Boot SPL 2024.04-ti-gfda88f8bcea3 (Jul 26 2024 - 11:00:12 +0000) SYSFW ABI: 4.0 (firmware rev 0x000a '10.0.8--v10.00.08 (Fiery Fox)') SPL initial stack usage: 1904 bytes Trying to boot from MMC2 i2c_write: error waiting for data ACK (status=0x116) pca953x gpio@22: Error reading output register Error reading cluster
U-Boot SPL 2024.04-ti-gfda88f8bcea3 (Jul 26 2024 - 11:00:12 +0000)
SYSFW ABI: 4.0 (firmware rev 0x000a '10.0.8--v10.00.08 (Fiery Fox)')
SPL initial stack usage: 1904 bytes
Trying to boot from MMC2
Authentication passed
Authentication passed
U-Boot 2024.04-ti-gfda88f8bcea3 (Jul 26 2024 - 11:00:12 +0000)
SoC: AM62PX SR1.0 HS-SE
Model: Texas Instruments AM62P5 SK
DRAM: 2 GiB (effective 8 GiB)
Core: 84 devices, 30 uclasses, devicetree: separate
MMC: mmc@fa10000: 0, mmc@fa00000: 1
Loading Environment from nowhere... OK
In: serial
Out: serial
Err: serial
Net: eth0: ethernet@8000000port@1
Warning: ethernet@8000000port@2 (eth1) using random MAC address - ca:15:05:97:20:2e
, eth1: ethernet@8000000port@2
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc1 is current device
SD/MMC found on device 1
Failed to load 'uEnv.txt'
Failed to load '/boot/fitImage'
Wrong Image Type for bootm command
ERROR -91: can't get kernel image!
Scanning for bootflows in all bootdevs
Seq Method State Uclass Part Name Filename
--- ----------- ------ -------- ---- ------------------------ ----------------
Scanning global bootmeth 'efi_mgr':
No EFI system partition
No EFI system partition
Failed to persist EFI variables
No EFI system partition
Failed to persist EFI variables
No EFI system partition
Failed to persist EFI variables
No EFI system partition
Failed to persist EFI variables
No EFI system partition
Failed to persist EFI variables
0 efi_mgr ready (none) 0 <NULL>
** Booting bootflow '<NULL>' with efi_mgr
Loading Boot0000 'mmc 1' failed
Loading Boot0001 'mmc 0' failed
EFI boot manager: Cannot load any image
Boot failed (err=-14)
Scanning bootdev 'mmc@fa00000.bootdev':
Scanning bootdev 'mmc@fa10000.bootdev':
Bus usb@31100000: Register 1000840 NbrPorts 1
Starting the controller
USB XHCI 1.10
scanning bus usb@31100000 for devices... 1 USB Device(s) found
ethernet@8000000port@1 Waiting for PHY auto negotiation to complete......... TIMEOUT !
am65_cpsw_nuss_port ethernet@8000000port@1: phy_startup failed
am65_cpsw_nuss_port ethernet@8000000port@1: am65_cpsw_start end error
ethernet@8000000port@2 Waiting for PHY auto negotiation to complete......... TIMEOUT !
am65_cpsw_nuss_port ethernet@8000000port@2: phy_startup failed
am65_cpsw_nuss_port ethernet@8000000port@2: am65_cpsw_start end error
ethernet@8000000port@1 Waiting for PHY auto negotiation to complete......... TIMEOUT !
am65_cpsw_nuss_port ethernet@8000000port@1: phy_startup failed
am65_cpsw_nuss_port ethernet@8000000port@1: am65_cpsw_start end error
ethernet@8000000port@2 Waiting for PHY auto negotiation to complete......... TIMEOUT !
am65_cpsw_nuss_port ethernet@8000000port@2: phy_startup failed
am65_cpsw_nuss_port ethernet@8000000port@2: am65_cpsw_start end error
No more bootdevs
--- ----------- ------ -------- ---- ------------------------ ----------------
(1 bootflow, 1 valid)
=>
=> 2
Unknown command '2' - try 'help'
=> 2d
Unknown command '2d' - try 'help'
=>
Unknown command '2d' - try 'help'
=> print bootpart
bootpart=1:2
=> ext
ext2load ext2ls ext4load ext4ls ext4size ext4write
=> ext4l
ext4load ext4ls
=> ex
exit ext2load ext2ls ext4load ext4ls ext4size ext4write
=> ext4
ext4load ext4ls ext4size ext4write
=> ext4ls mmc 1:2
<DIR> 4096 .
<DIR> 4096 ..
<DIR> 16384 lost+found
<SYM> 7 bin
<DIR> 4096 boot
<DIR> 4096 data
<DIR> 4096 dev
<DIR> 4096 etc
<DIR> 4096 home
<SYM> 7 lib
<DIR> 4096 media
<DIR> 4096 mnt
<DIR> 4096 opt
<DIR> 4096 proc
<DIR> 4096 root
<DIR> 4096 run
<SYM> 8 sbin
<DIR> 4096 srv
<DIR> 4096 sys
<DIR> 4096 tmp
<DIR> 4096 usr
<DIR> 4096 var
19 version
=> ext4ls mmc 1:2 /boot
<DIR> 4096 .
<DIR> 4096 ..
21107200 Image
<DIR> 4096 dtb
=> boot
switch to partitions #0, OK
mmc1 is current device
SD/MMC found on device 1
Failed to load 'uEnv.txt'
Failed to load '/boot/fitImage'
Wrong Image Type for bootm command
ERROR -91: can't get kernel image!
Scanning for bootflows in all bootdevs
Seq Method State Uclass Part Name Filename
--- ----------- ------ -------- ---- ------------------------ ----------------
Scanning global bootmeth 'efi_mgr':
0 efi_mgr ready (none) 0 <NULL>
** Booting bootflow '<NULL>' with efi_mgr
Loading Boot0000 'mmc 1' failed
Loading Boot0001 'mmc 0' failed
EFI boot manager: Cannot load any image
Boot failed (err=-14)
Scanning bootdev 'mmc@fa00000.bootdev':
Scanning bootdev 'mmc@fa10000.bootdev':
ethernet@8000000port@1 Waiting for PHY auto negotiation to complete......... TIMEOUT !
am65_cpsw_nuss_port ethernet@8000000port@1: phy_startup failed
am65_cpsw_nuss_port ethernet@8000000port@1: am65_cpsw_start end error
ethernet@8000000port@2 Waiting for PHY auto negotiation to complete.......
Hi,Prashant
After solving the ddr problems ,I encountered some new problems .
The first output is on my customer board. The second one is from the official board.
Can you tell me the possible reason for this ?