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.
Hello TI,
I have a 2 core variant AM2432B and would like to run the example of the SBL_OSPI provided in the mcu_plus_sdk_am243x_08_05_00_24.
But, I am facing an error at the following line defined in main.c
"status = Bootloader_loadSelfCpu(bootHandle, &bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS0_1]);"
During debugging of the program, the value of the status is -1.
Can you please let me know, how to resolve this error?
Thanks & Regards
Teja
Hi Teja Poorna,
Apologies for the delay in answering your question. In the App Image created which CPU cores and RPRC images are used for the same ?
Checkout the datasheet - https://www.ti.com/lit/ds/symlink/am2434.pdf?ts=1678710212155&ref_url=https%253A%252F%252Fwww.google.com%252F
The valid CPUs are R5F0-0 and R5F1-0. There is a mistake in the App image created. You need to create App Image with valid CPUs only.
Best Regards,
Aakash
Hi Aakash,
Can you please let me know, where I can find, which CPU cores and RPRC images are used for creating the App Image?
Because, I have made the following changes in the SBL_OSPI example main.c file as shown below
if(TRUE == Bootloader_isCorePresent(bootHandle, CSL_CORE_ID_R5FSS1_0)) /* Here it is returning false */
{
isSelfBoot = TRUE;
Bootloader_profileAddCore(CSL_CORE_ID_R5FSS1_0);
}
/* Self cores has to be reset together, so check for both */
if(status == SystemP_SUCCESS && (TRUE == isSelfBoot))
{
/* Set clocks for self cluster */
bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS0_0].clkHz = Bootloader_socCpuGetClkDefault(CSL_CORE_ID_R5FSS0_0);
//bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS0_1].clkHz = Bootloader_socCpuGetClkDefault(CSL_CORE_ID_R5FSS0_1);
bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS0_1].clkHz = Bootloader_socCpuGetClkDefault(CSL_CORE_ID_R5FSS1_0);
/* Reset self cluster, both Core0 and Core 1. Init RAMs and load the app */
status = Bootloader_loadSelfCpu(bootHandle, &bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS0_0]);
if(status == SystemP_SUCCESS)
{
//status = Bootloader_loadSelfCpu(bootHandle, &bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS0_1]);
status = Bootloader_loadSelfCpu(bootHandle, &bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS1_0]); /* It is not working as expected after changing the core to R5FSS1_0 */
}
}
But still no success, Could you provide more info on this topic?
Best Regards,
Teja
Hi Teja Poorna,
Please find the documentation for RPRC and Multicore Image.
No, the understanding is not correct. The device does not have R5FSS0_1 and PRFSS1_1. You need not change the example of the SBL. The SBL is functional for subset devices as well.
Can you tell me which example are you trying to run ? Is it a hello_world example or is that a system project ?
Also can you confirm the CTRLMMR_JTAG_DEVICE_ID[31:13] DEVICE_ID register ?
Best Regards,
Aakash
Hi Aakash,
Thanks for the quick reply.
I have my own project with only CoreR5FSS0_0 and I am trying to flash it via SBL_OSPI.
After reading the documentation, what I understand is that,
If a multicore appimage is found at the location, the SBL parses it, splits it into RPRCs for each core applicable. Each core is then initialized, RPRC image is loaded, entry points are set and the core is released from reset.
if the appimage is a single core, then only that core is initialized and we cannot access the other cores. Am I correct?
BR
Teja
Hi Teja Poorna,
if the appimage is a single core, then only that core is initialized and we cannot access the other cores. Am I correct?
Yes that's absolutely correct. The other cores have not deasserted the reset/enabled the clocks by the SBL and hence not enabled at all.
Best Regards,
Aakash
HI Aakash,
To have a better understanding of the topic, I created the following scenarios
You need not change the example of the SBL. The SBL is functional for subset devices as well.
without changing anything in the SBL_OSPI example.
Case 1:-
Processor:- AM2432B
BOOTIMAGE:- sbl_ospi.Debug.hs_fs.tiimage
APPIMAGE:- Single core appimage only with R5FSS0_0 Core enabled.
After flashing the files, I receive the following error on the UART terminal as shown below and the application does not start up.
Case 2:-
Processor:- AM2434B
BOOTIMAGE:- sbl_ospi.Debug.hs_fs.tiimage
APPIMAGE:- Single core appimage with R5FSS0_0 Core enabled as above.
After flashing the files, the application starts up as shown below.
From the above definition, if the appimage is a single core, then only that core is initialized. Since both the processors contain the R5FSS0_0 core they should work as accepted.
During Debugging of the example bootloader, it checks for the cores R5FSS0_0 as well as R5FSS0_1 irrespective of the processor and hence this is leading to the error in AM2432B at the following line.
/* Reset self cluster, both Core0 and Core 1. Init RAMs and load the app */
status = Bootloader_loadSelfCpu(bootHandle, &bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS0_0]);
if(status == SystemP_SUCCESS)
{
status = Bootloader_loadSelfCpu(bootHandle, &bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS0_1]);
}
But, this check is successful in AM2434B.
Also can you confirm the CTRLMMR_JTAG_DEVICE_ID[31:13] DEVICE_ID register ?
The DEVICE_ID can be found in the attachment.
Looking forward for the information.
Best Regards
Teja
Hi Teja Poorna,
Are you sure you are with mcu_plus_sdk_am243x_08_05_00_24 ?
I think this SW should have a check like this -
Hence, this should never have been an error like you have. Attaching the released main.c for the reference.
/* * Copyright (C) 2018-2022 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 <drivers/sciclient.h> #include <drivers/bootloader.h> void flashFixUpOspiBoot(OSPI_Handle oHandle, Flash_Handle fHandle); /* 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) ; } int main(void) { int32_t status; Bootloader_profileReset(); Bootloader_socWaitForFWBoot(); #ifndef DISABLE_WARM_REST_WA /* Warm Reset Workaround to prevent CPSW register lockup */ if (!Bootloader_socIsMCUResetIsoEnabled()) { Bootloader_socResetWorkaround(); } #endif Bootloader_profileAddProfilePoint("SYSFW init"); if (!Bootloader_socIsMCUResetIsoEnabled()) { /* Update devGrp to ALL to initialize MCU domain when reset isolation is not enabled */ Sciclient_BoardCfgPrms_t boardCfgPrms_pm = { .boardConfigLow = (uint32_t)0, .boardConfigHigh = 0, .boardConfigSize = 0, .devGrp = DEVGRP_ALL, }; status = Sciclient_boardCfgPm(&boardCfgPrms_pm); /* Enable MCU PLL. MCU PLL will not be enabled by DMSC when devGrp is set to Main in boardCfg */ Bootloader_enableMCUPLL(); } Bootloader_socOpenFirewalls(); Bootloader_socNotifyFirewallOpen(); System_init(); Bootloader_profileAddProfilePoint("System_init"); Drivers_open(); Bootloader_profileAddProfilePoint("Drivers_open"); #if 0 DebugP_log("\r\n"); DebugP_log("Starting OSPI Bootloader ... \r\n"); #endif /* ROM doesn't reset the OSPI flash. This can make the flash initialization troublesome because sequences are very different in Octal DDR mode. So for a moment switch OSPI controller to 8D mode and do a flash reset. */ flashFixUpOspiBoot(gOspiHandle[CONFIG_OSPI0], gFlashHandle[CONFIG_FLASH0]); status = Board_driversOpen(); DebugP_assert(status == SystemP_SUCCESS); Bootloader_profileAddProfilePoint("Board_driversOpen"); status = Sciclient_getVersionCheck(1); Bootloader_profileAddProfilePoint("Sciclient Get Version"); 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_BOOTLOADER_FLASH0, &bootParams); if(bootHandle != NULL) { status = Bootloader_parseMultiCoreAppImage(bootHandle, &bootImageInfo); /* Load CPUs */ /* Do not load M4 when MCU domain is reset isolated */ if (!Bootloader_socIsMCUResetIsoEnabled()) { if(status == SystemP_SUCCESS && (TRUE == Bootloader_isCorePresent(bootHandle, CSL_CORE_ID_M4FSS0_0))) { bootImageInfo.cpuInfo[CSL_CORE_ID_M4FSS0_0].clkHz = Bootloader_socCpuGetClkDefault(CSL_CORE_ID_M4FSS0_0); Bootloader_profileAddCore(CSL_CORE_ID_M4FSS0_0); status = Bootloader_loadCpu(bootHandle, &bootImageInfo.cpuInfo[CSL_CORE_ID_M4FSS0_0]); } } 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_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]); } /* Assume self boot for either of the cores of R50 cluster */ uint32_t isSelfBoot = FALSE; if(TRUE == Bootloader_isCorePresent(bootHandle, CSL_CORE_ID_R5FSS0_0)) { isSelfBoot = TRUE; Bootloader_profileAddCore(CSL_CORE_ID_R5FSS0_0); } if(TRUE == Bootloader_isCorePresent(bootHandle, CSL_CORE_ID_R5FSS0_1)) { isSelfBoot = TRUE; Bootloader_profileAddCore(CSL_CORE_ID_R5FSS0_1); } /* Self cores has to be reset together, so check for both */ if(status == SystemP_SUCCESS && (TRUE == isSelfBoot)) { /* Set clocks for self cluster */ bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS0_0].clkHz = Bootloader_socCpuGetClkDefault(CSL_CORE_ID_R5FSS0_0); bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS0_1].clkHz = Bootloader_socCpuGetClkDefault(CSL_CORE_ID_R5FSS0_1); /* Reset self cluster, both Core0 and Core 1. Init RAMs and load the app */ status = Bootloader_loadSelfCpu(bootHandle, &bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS0_0]); if(status == SystemP_SUCCESS) { status = Bootloader_loadSelfCpu(bootHandle, &bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS0_1]); } } Bootloader_profileAddProfilePoint("CPU load"); Bootloader_profileUpdateAppimageSize(Bootloader_getMulticoreImageSize(bootHandle)); Bootloader_profileUpdateMediaAndClk(BOOTLOADER_MEDIA_FLASH, OSPI_getInputClk(gOspiHandle[CONFIG_OSPI0])); #if 1 if( status == SystemP_SUCCESS) { /* enable Phy and Phy pipeline for XIP execution */ if( OSPI_isPhyEnable(gOspiHandle[CONFIG_OSPI0]) ) { status = OSPI_enablePhy(gOspiHandle[CONFIG_OSPI0]); DebugP_assert(status == SystemP_SUCCESS); status = OSPI_enablePhyPipeline(gOspiHandle[CONFIG_OSPI0]); DebugP_assert(status == SystemP_SUCCESS); } } #endif if(status == SystemP_SUCCESS) { /* Print SBL Profiling logs to UART as other cores may use the UART for logging */ Bootloader_profileAddProfilePoint("SBL End"); Bootloader_profilePrintProfileLog(); DebugP_log("Image loading done, switching to application ...\r\n"); UART_flushTxFifo(gUartHandle[CONFIG_UART0]); } /* Run CPUs */ /* Do not run M4 when MCU domain is reset isolated */ if (!Bootloader_socIsMCUResetIsoEnabled()) { if(status == SystemP_SUCCESS && (TRUE == Bootloader_isCorePresent(bootHandle, CSL_CORE_ID_M4FSS0_0))) { status = Bootloader_runCpu(bootHandle, &bootImageInfo.cpuInfo[CSL_CORE_ID_M4FSS0_0]); } } if(status == SystemP_SUCCESS && (TRUE == Bootloader_isCorePresent(bootHandle, CSL_CORE_ID_R5FSS1_1))) { status = Bootloader_runCpu(bootHandle, &bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS1_0]); } 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 == isSelfBoot)) { /* Reset self cluster, both Core0 and Core 1. Init RAMs and run the app */ 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; } void flashFixUpOspiBoot(OSPI_Handle oHandle, Flash_Handle fHandle) { OSPI_setProtocol(oHandle, OSPI_NOR_PROTOCOL(8,8,8,1)); OSPI_enableDDR(oHandle); OSPI_setDualOpCodeMode(oHandle); Flash_reset(fHandle); OSPI_enableSDR(oHandle); OSPI_clearDualOpCodeMode(oHandle); OSPI_setProtocol(oHandle, OSPI_NOR_PROTOCOL(1,1,1,0)); }
Hope this helps.
Best Regards,
Aakash
Hi Aakash,
Are you sure you are with mcu_plus_sdk_am243x_08_05_00_24 ?
Yes, we are using the mcu_plus_sdk_am243x_08_05_00_24.
Attaching the released main.c for the reference.
In the attached main.c reference, I don't find the SW check function that has been defined by you in the image.
Can you please have a look at the attached main.c from lines 174 to 180? it just checks the status, but not whether it is a Dual core?
Best Regards
Teja
Hi Teja Poorna,
Seems like this is fixed in the latest revision. My bad. Sharing the file.
/* * Copyright (C) 2018-2022 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 <drivers/sciclient.h> #include <drivers/bootloader.h> void flashFixUpOspiBoot(OSPI_Handle oHandle, Flash_Handle fHandle); /* 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) ; } int main(void) { int32_t status; Bootloader_profileReset(); Bootloader_socWaitForFWBoot(); #ifndef DISABLE_WARM_REST_WA /* Warm Reset Workaround to prevent CPSW register lockup */ if (!Bootloader_socIsMCUResetIsoEnabled()) { Bootloader_socResetWorkaround(); } #endif Bootloader_profileAddProfilePoint("SYSFW init"); if (!Bootloader_socIsMCUResetIsoEnabled()) { /* Update devGrp to ALL to initialize MCU domain when reset isolation is not enabled */ Sciclient_BoardCfgPrms_t boardCfgPrms_pm = { .boardConfigLow = (uint32_t)0, .boardConfigHigh = 0, .boardConfigSize = 0, .devGrp = DEVGRP_ALL, }; status = Sciclient_boardCfgPm(&boardCfgPrms_pm); /* Enable MCU PLL. MCU PLL will not be enabled by DMSC when devGrp is set to Main in boardCfg */ Bootloader_enableMCUPLL(); } Bootloader_socOpenFirewalls(); Bootloader_socNotifyFirewallOpen(); System_init(); Bootloader_profileAddProfilePoint("System_init"); Drivers_open(); Bootloader_profileAddProfilePoint("Drivers_open"); #if 0 DebugP_log("\r\n"); DebugP_log("Starting OSPI Bootloader ... \r\n"); #endif /* ROM doesn't reset the OSPI flash. This can make the flash initialization troublesome because sequences are very different in Octal DDR mode. So for a moment switch OSPI controller to 8D mode and do a flash reset. */ flashFixUpOspiBoot(gOspiHandle[CONFIG_OSPI0], gFlashHandle[CONFIG_FLASH0]); status = Board_driversOpen(); DebugP_assert(status == SystemP_SUCCESS); Bootloader_profileAddProfilePoint("Board_driversOpen"); status = Sciclient_getVersionCheck(1); Bootloader_profileAddProfilePoint("Sciclient Get Version"); 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_BOOTLOADER_FLASH0, &bootParams); if(bootHandle != NULL) { status = Bootloader_parseMultiCoreAppImage(bootHandle, &bootImageInfo); /* Load CPUs */ /* Do not load M4 when MCU domain is reset isolated */ if (!Bootloader_socIsMCUResetIsoEnabled()) { if(status == SystemP_SUCCESS && (TRUE == Bootloader_isCorePresent(bootHandle, CSL_CORE_ID_M4FSS0_0))) { bootImageInfo.cpuInfo[CSL_CORE_ID_M4FSS0_0].clkHz = Bootloader_socCpuGetClkDefault(CSL_CORE_ID_M4FSS0_0); Bootloader_profileAddCore(CSL_CORE_ID_M4FSS0_0); status = Bootloader_loadCpu(bootHandle, &bootImageInfo.cpuInfo[CSL_CORE_ID_M4FSS0_0]); } } 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_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]); } /* Assume self boot for either of the cores of R50 cluster */ uint32_t isSelfBoot = FALSE; if(TRUE == Bootloader_isCorePresent(bootHandle, CSL_CORE_ID_R5FSS0_0)) { isSelfBoot = TRUE; Bootloader_profileAddCore(CSL_CORE_ID_R5FSS0_0); } if(TRUE == Bootloader_isCorePresent(bootHandle, CSL_CORE_ID_R5FSS0_1)) { isSelfBoot = TRUE; Bootloader_profileAddCore(CSL_CORE_ID_R5FSS0_1); } /* Self cores has to be reset together, so check for both */ if(status == SystemP_SUCCESS && (TRUE == isSelfBoot)) { /* Set clocks for self cluster */ bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS0_0].clkHz = Bootloader_socCpuGetClkDefault(CSL_CORE_ID_R5FSS0_0); bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS0_1].clkHz = Bootloader_socCpuGetClkDefault(CSL_CORE_ID_R5FSS0_1); /* Reset self cluster, both Core0 and Core 1. Init RAMs and load the app */ status = Bootloader_loadSelfCpu(bootHandle, &bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS0_0]); if((status == SystemP_SUCCESS) && (TRUE == Bootloader_socIsR5FSSDual(BOOTLOADER_R5FSS0))) { status = Bootloader_loadSelfCpu(bootHandle, &bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS0_1]); } } Bootloader_profileAddProfilePoint("CPU load"); Bootloader_profileUpdateAppimageSize(Bootloader_getMulticoreImageSize(bootHandle)); Bootloader_profileUpdateMediaAndClk(BOOTLOADER_MEDIA_FLASH, OSPI_getInputClk(gOspiHandle[CONFIG_OSPI0])); #if 1 if( status == SystemP_SUCCESS) { /* enable Phy and Phy pipeline for XIP execution */ if( OSPI_isPhyEnable(gOspiHandle[CONFIG_OSPI0]) ) { status = OSPI_enablePhy(gOspiHandle[CONFIG_OSPI0]); DebugP_assert(status == SystemP_SUCCESS); status = OSPI_enablePhyPipeline(gOspiHandle[CONFIG_OSPI0]); DebugP_assert(status == SystemP_SUCCESS); } } #endif if(status == SystemP_SUCCESS) { /* Print SBL Profiling logs to UART as other cores may use the UART for logging */ Bootloader_profileAddProfilePoint("SBL End"); Bootloader_profilePrintProfileLog(); DebugP_log("Image loading done, switching to application ...\r\n"); UART_flushTxFifo(gUartHandle[CONFIG_UART0]); } /* Run CPUs */ /* Do not run M4 when MCU domain is reset isolated */ if (!Bootloader_socIsMCUResetIsoEnabled()) { if(status == SystemP_SUCCESS && (TRUE == Bootloader_isCorePresent(bootHandle, CSL_CORE_ID_M4FSS0_0))) { status = Bootloader_runCpu(bootHandle, &bootImageInfo.cpuInfo[CSL_CORE_ID_M4FSS0_0]); } } if(status == SystemP_SUCCESS && (TRUE == Bootloader_isCorePresent(bootHandle, CSL_CORE_ID_R5FSS1_1))) { status = Bootloader_runCpu(bootHandle, &bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS1_0]); } 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 == isSelfBoot)) { /* Reset self cluster, both Core0 and Core 1. Init RAMs and run the app */ 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; } void flashFixUpOspiBoot(OSPI_Handle oHandle, Flash_Handle fHandle) { OSPI_setProtocol(oHandle, OSPI_NOR_PROTOCOL(8,8,8,1)); OSPI_enableDDR(oHandle); OSPI_setDualOpCodeMode(oHandle); Flash_reset(fHandle); OSPI_enableSDR(oHandle); OSPI_clearDualOpCodeMode(oHandle); OSPI_setProtocol(oHandle, OSPI_NOR_PROTOCOL(1,1,1,0)); }
I have not checked if the Bootloader_socIsR5FSSDual is available in 08.05 release or not.
But I would suggest you to simply skip comment this code -
status = Bootloader_loadSelfCpu(bootHandle, &bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS0_1]);
I hope it helps.
Best Regards,
Aakash
Hi Aakash,
Thanks for the reply.
A final question, do we have any side effects, when i comment this line in the bootloader?
If not, I will adopt the function Bootloader_socIsR5FSSDual in the attachment.
Best Regards
Teja
Hi Teja,
In my opinion, there should not be any side effect because either way, Bootloader_socIsR5FSSDual will not allow
status = Bootloader_loadSelfCpu(bootHandle, &bootImageInfo.cpuInfo[CSL_CORE_ID_R5FSS0_1]);
the above mentioned code to execute.
Best Regards,
Aakash