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.
I refer to this URL link to optimize the boot time of RBL/SBL.
I use the tifs8..5+SDK8.6 to try.
1.I use the AM2634 in HS-SE mode(write some keys), so I shall complie tifs8.5 to generate new HSM(hsmRtImg.h).
2.Second, I modfiy SDK8.6 as shown in figure, and complie it (command:gmake libs-clean -s || gmake libs -s)
3.modify the flash chip ID in SBL_QSPI example, complie SBL_QSPI and sign it:
gmake -s -C ./examples/drivers/boot/sbl_qspi/am263x-cc/r5fss0-0_nortos/ti-arm-clang/ syscfg-gui
python mcu_rom_image_gen.py --image-bin sbl_qspi_am263x-cc_r5fss0-0_nortos_ti-arm-clang.bin --core R5 --swrv 1 --loadaddr 0x70002000 --sign-key mcu_custMpk.pem --out-image sbl_qspi_am263x-cc_r5fss0-0_nortos_ti-arm-clang.release.hs.tiimage --debug DBG_PUBLIC_ENABLE
gmake -C examples/drivers/boot/sbl_qspi/am263x-cc/r5fss0-0_nortos/ti-arm-clang/ all -s
4.complie the example of hello word(App). And burn SBL and helloword by uart.
5.power on the device again and start from the qspi, the reasult is that it successfully jumped from SBL to App.
Nextly, I want to separate SBL and HSM firmware(SBL without incorporated HSMRt firmware):
1.Use a patch file from TI E2E platform to change the SDK in order to optimize the boot time of RBL/SBL
git apply boot_5F00_time_5F00_1.diff
2.complie SDK8.6(command:gmake libs-clean -s||gmake libs -s)
3.complie SBL_QSPI and sign it:
python mcu_rom_image_gen.py --image-bin sbl_qspi_am263x-cc_r5fss0-0_nortos_ti-arm-clang.bin --core R5 --swrv 1 --loadaddr 0x70002000 --sign-key mcu_custMpk.pem --out-image sbl_qspi_am263x-cc_r5fss0-0_nortos_ti-arm-clang.release.hs.tiimage --debug DBG_PUBLIC_ENABLE
gmake -C examples/drivers/boot/sbl_qspi/am263x-cc/r5fss0-0_nortos/ti-arm-clang/ all -s
11.use array2bin.c, Convert the hsmRtImg.h file to hsmRtImg.bin
12.burn them by uart (SBL+HSM+helloword),HSM is in 0xA0000
13.power on the device again and start from the qspi, the reasult is that it failurely jumped from SBL to App.
In addition, the same attempt was made in tifs8.6+sdk9.0.0.13 and the same results were obtained. (Every attempt is in HS-SE mode, not do same attempt in HS-FS mode, maybe it is a useful information)
Hi ?? ?,
Can you try using this file ?
/* * Copyright (C) 2018-2021 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 "ti_drivers_config.h" #include "ti_drivers_open_close.h" #include "ti_board_open_close.h" #include "ti_board_config.h" #include <drivers/bootloader.h> #include <drivers/hsmclient.h> #include <drivers/hsmclient/soc/am263x/hsmRtImg.h> /* hsmRt bin header file */ #if 0 const uint8_t gHsmRtFw[HSMRT_IMG_SIZE_IN_BYTES]__attribute__((section(".rodata.hsmrt"))) = HSMRT_IMG; #else //uint8_t gHsmRtFw[HSMRT_IMG_SIZE_IN_BYTES]; #endif /* 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(void) { volatile uint32_t loop = 1; while(loop) ; } #if 0 void GPIO_TOGGLE(uint32_t baseAddr, uint32_t pinNum) { if(GPIO_pinOutValueRead(baseAddr, pinNum) == 1) { GPIO_pinWriteLow(baseAddr, pinNum); } else { GPIO_pinWriteHigh(baseAddr, pinNum); } } #else void GPIO_TOGGLE(uint32_t baseAddr, uint32_t pinNum) { (void)baseAddr; (void)pinNum; } #endif int main(void) { int32_t status; //uint32_t gpioBaseAddr = (uint32_t) AddrTranslateP_getLocalAddr(CONFIG_GPIO0_BASE_ADDR); //uint32_t pinNum = CONFIG_GPIO0_PIN; uint32_t gpioBaseAddr = 0; uint32_t pinNum = 0; Bootloader_profileReset(); Bootloader_socConfigurePll(); Bootloader_socInitL2MailBoxMemory(); Bootloader_socCpuSetClock(CSL_CORE_ID_R5FSS0_0, (uint32_t)(400*1000000)); System_init(); Bootloader_profileAddProfilePoint("System_init"); GPIO_TOGGLE(gpioBaseAddr, pinNum); Drivers_open(); Bootloader_profileAddProfilePoint("Drivers_open"); GPIO_TOGGLE(gpioBaseAddr, pinNum); status = Board_driversOpen(); DebugP_assert(status == SystemP_SUCCESS); Bootloader_profileAddProfilePoint("Board_driversOpen"); GPIO_TOGGLE(gpioBaseAddr, pinNum); DebugP_log("\r\n"); Flash_read(gFlashHandle[0U], 0xA0000, (uint8_t *)0x70100000U, HSMRT_IMG_SIZE_IN_BYTES); Bootloader_profileAddProfilePoint("LoadHsmRtFw into On-Chip RAM"); GPIO_TOGGLE(gpioBaseAddr, pinNum); Bootloader_socLoadHsmRtFw((uint8_t *)0x70100000U, HSMRT_IMG_SIZE_IN_BYTES); Bootloader_profileAddProfilePoint("LoadHsmRtFw Request to ROM"); GPIO_TOGGLE(gpioBaseAddr, pinNum); Hsmclient_loadHSMRtFirmwareClient(); Bootloader_profileAddProfilePoint("HSM Client Register"); GPIO_TOGGLE(gpioBaseAddr, pinNum); DebugP_log("Starting QSPI Bootloader ... \r\n"); if(SystemP_SUCCESS == status) { Bootloader_BootImageInfo bootImageInfo; Bootloader_Params bootParams; Bootloader_Handle bootHandle; Bootloader_Params_init(&bootParams); Bootloader_BootImageInfo_init(&bootImageInfo); bootHandle = Bootloader_open(CONFIG_BOOTLOADER0, &bootParams); if(bootHandle != NULL) { status = Bootloader_parseMultiCoreAppImage(bootHandle, &bootImageInfo); /* Load CPUs */ if((status == SystemP_SUCCESS) && (TRUE == Bootloader_isCorePresent(bootHandle, CSL_CORE_ID_R5FSS1_1))) { bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS1_1].clkHz = Bootloader_socCpuGetClkDefault(CSL_CORE_ID_R5FSS1_1); Bootloader_profileAddCore(CSL_CORE_ID_R5FSS1_1); status = Bootloader_loadCpu(bootHandle, &bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS1_1]); } if ((status == SystemP_SUCCESS) && (TRUE == Bootloader_isCorePresent(bootHandle, CSL_CORE_ID_R5FSS1_0))) { bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS1_0].clkHz = Bootloader_socCpuGetClkDefault(CSL_CORE_ID_R5FSS1_0); Bootloader_profileAddCore(CSL_CORE_ID_R5FSS1_0); status = Bootloader_loadCpu(bootHandle, &bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS1_0]); } if ((status == SystemP_SUCCESS) && (TRUE == Bootloader_isCorePresent(bootHandle, CSL_CORE_ID_R5FSS0_1))) { bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS0_1].clkHz = Bootloader_socCpuGetClkDefault(CSL_CORE_ID_R5FSS0_1); Bootloader_profileAddCore(CSL_CORE_ID_R5FSS0_1); status = Bootloader_loadCpu(bootHandle, &bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS0_1]); } Bootloader_profileAddProfilePoint("CPU load"); Bootloader_profileUpdateAppimageSize(Bootloader_getMulticoreImageSize(bootHandle)); GPIO_TOGGLE(gpioBaseAddr, pinNum); Hsmclient_loadHSMRtFirmwareROMCheckBlocking(); Bootloader_profileAddProfilePoint("LoadHsmRtFw confirmation from ROM"); GPIO_TOGGLE(gpioBaseAddr, pinNum); Hsmclient_loadHSMRtFirmwareWaitforNotify(); Bootloader_profileAddProfilePoint("HsmRT BootNotify Request"); GPIO_TOGGLE(gpioBaseAddr, pinNum); QSPI_Handle qspiHandle = QSPI_getHandle(CONFIG_QSPI0); Bootloader_profileUpdateMediaAndClk(BOOTLOADER_MEDIA_FLASH, QSPI_getInputClk(qspiHandle)); if(status == SystemP_SUCCESS) { Bootloader_profileAddProfilePoint("SBL End"); GPIO_TOGGLE(gpioBaseAddr, pinNum); Bootloader_profilePrintProfileLog(); DebugP_log("Image loading done, switching to application ...\r\n"); UART_flushTxFifo(gUartHandle[CONFIG_UART0]); } if((status == SystemP_SUCCESS) && (TRUE == Bootloader_isCorePresent(bootHandle, CSL_CORE_ID_R5FSS0_0))) { bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS0_0].clkHz = Bootloader_socCpuGetClkDefault(CSL_CORE_ID_R5FSS0_0); Bootloader_profileAddCore(CSL_CORE_ID_R5FSS0_0); status = Bootloader_loadCpu(bootHandle, &bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS0_0]); } /* Run CPUs */ if((status == SystemP_SUCCESS) && (TRUE == Bootloader_isCorePresent(bootHandle, CSL_CORE_ID_R5FSS1_1))) { status = Bootloader_runCpu(bootHandle, &bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS1_1]); } if((status == SystemP_SUCCESS) && (TRUE == Bootloader_isCorePresent(bootHandle, CSL_CORE_ID_R5FSS1_0))) { status = Bootloader_runCpu(bootHandle, &bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS1_0]); } if((status == SystemP_SUCCESS) && (TRUE == Bootloader_isCorePresent(bootHandle, CSL_CORE_ID_R5FSS0_1))) { status = Bootloader_runCpu(bootHandle, &bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS0_1]); } if((status == SystemP_SUCCESS) && (TRUE == Bootloader_isCorePresent(bootHandle, CSL_CORE_ID_R5FSS0_0))) { //GPIO_pinWriteLow(gpioBaseAddr, pinNum); /* If any of the R5 core 0 have valid image reset the R5 core. */ status = Bootloader_runSelfCpu(bootHandle, &bootImageInfo); } /* it should not return here, if it does, then there was some error */ Bootloader_close(bootHandle); } } if(status != SystemP_SUCCESS ) { DebugP_log("Some tests have failed!!\r\n"); } Drivers_close(); System_deinit(); return 0; }
This file optimizes has been tested on HSSE device for 09.02 release. Do let me know if this helps.
Best Regards,
Aakash
Can you provide the diff file corresponding to SDK9.2? The diff files linked below are applicable to SDK8.5, but are slightly different in other versions and cannot be used directly.
Hi,
We cannot provide any interim fixes and as the secondary bootloaders are customer owned, it should be in customers responsibility to keep up with the modifications.
Anyways, the FAQ is planned to be integrate as part of 10.00 release (upcoming in Aug 2024).
I hope this helps.
Best Regards,
Aakash