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.

AM263P4: OSPI BL

Part Number: AM263P4
Other Parts Discussed in Thread: UNIFLASH, SYSCONFIG, MCU-PLUS-SDK-AM263PX

Is it possible to program the OSPI SBL (Secondary Bootloader) once on the AM263Px controller so that, on every power-on reset, it automatically initializes an application from OSPI without a debugger or emulator?

Regards 

Shashank B.

  • Hi Shashank,

    If I understand the question correctly, you wish to run the Secondary bootloader (after power cycle and ROM bootloader runs), and the application is loaded from an OSPI Flash (given that the application is already flashed to the AM263Px)?

    If yes,

    You can use the UniFlash tool and use SBL OSPI .tiimage and select the desired application image and flash it to the device (in UART Bootmode), then change boot-mode to OSPI and power-cycle.

    UniFlash tool

    AM263Px_Bootmodes

    Regards,
    Shaunak

  • Hi Shaunak,

    My question is: should the SBL image be flashed again after every power-on reset?

    Regards,

    Shashank B,

  • Is it possible to program the OSPI SBL (Secondary Bootloader) once on the AM263Px controller so that, on every power-on reset, it automatically initializes an application from OSPI without a debugger or emulator?

    That's how the device works by default.

    should the SBL image be flashed again after every power-on reset?

    No. The SBL remains permanently in the OSPI flash, same as the application.

  • My question is: should the SBL image be flashed again after every power-on reset?

    Hi Shashank,

    You don't need to flash the SBL in every iteration, but based on our conversation so far and on the other E2E, you are not "flashing" the SBL, you are just loading the .out binary to RAM, which will get erased on a power-reset. To have the SBL run every time, you will have to "flash" the SBL Image. If using SBL OSPI, it will also expect an application image (by default at address 0x81000), please refer the links in my previous response to understand how to use the flashing tools.

    You can also refer this video training on UniFlash:https://www.ti.com/video/6362394255112

    Regards,
    Shaunak

  • Hi Shaunak,

    I’m getting an error when attempting to load the image. Please refer to the attached screenshot for details.

    Regards,

    Shashank B

  • Hi Shashank B,

    Can you please help me with the following details:

    1. Is the XDS cable connected to your PC and the AM263Px (the XDS/JTAG port is beside the power supply port). If connected, can you power cycle and try to connect again? Also make sure there is no CCS debug session running parallelly/ UART terminal open, blocking the XDS port.

    2. What is the bootmode here? 

    3. What is the version of CCS and UniFlash being used?

    4. Can you navigate to: ccsxxxx\ccs\ccs_base\common\uscif\xds110 and launch a command prompt terminal and enter the following:

    Here the XDS firmware version on my control card is 3.0.0.38, and the one provided in CCS2030 is the same. If there is a version mismatch you can upgrade your firmware version following the readme file in the same folder.

    Regads,
    Shaunak

  • It’s working fine now.

    Thanks and regards,
    Shashank B.

  • I am unable to boot the multicore environment using the OSPI SBL Multicore ELF example. I loaded the multicore environment into OSPI using UniFlash, but it does not boot. How should I correctly load and boot a multicore environment using the available examples?

    Regards,

    Shashank B

  • Hi Shashank,

    Can you share some more information? What exactly do you mean by unable to boot? Does the UniFlash say successful loading? Do you switch the bootmode before flashing, and after flashing and then power-cycle?

    Can you share the address at which you have flashed your application? Is this a default SDK application with the default sbl-ospi multicore elf provided?

    If possible can you also share SDK version as well as the EVK you are using (would be great if you can also share the PROC# version, like PROC E2, PROC A). It would be a white label pasted on the ControlCard or the LaunchPad you have.

    How should I correctly load and boot a multicore environment using the available examples?

    You will have to just configure the correct boot-mode, load the SBL tiimage, load the multi-core appimage mcelf at the correct address, then flash, then change the bootmode to OSPI, and power cycle. The application should boot fine.

    Regards,
    Shaunak

  • I am loading the multi-core environment image, ospi_sbl_multicore_elf example in mcu_plus_sdk_am263px_10_02_00_15, into OSPI using Uniflash (loading successfully). After that, I am loading symbols via CCS to check whether the code is running or not.

    Regrads

    Shashank

  • To try and debug the SBL, you would need to place an infinite while loop at the start of the SBL application. At runtime, the SBL would have already been loaded by the ROM and executed, you cannot stop that unless you have a some sort of blocker (infinite loop) in the code.

    If you inspect the SBL code, there would be an infinite loop function in the start of the file, just call the loop_forever() in the start of main(). Then re-build the SBL application and use this .tiimage in debug build. Now, when you flash this to the device, your code will be stuck in this loop, you can now load the symbols and then come out of this loop manually.

    To check if the SBL is working, i'd recommend you also flash an actual application along with the SBL .tiimage. If SBL works, the appimage will be copied from Flash to RAM and execute as expected.

  • I am already using infinite while loop in each core project for this purpose. 

  • To debug Application, not to debug SBL.

  • Hi Shashank,

    If your SBL is working fine, then before your application starts, you would see some logs, for example, if i just use hello_world application, I'd see SBL OSPI logs before the SBL hands over the control to the application. In your case, since the application has a while loop, can you confirm if you see the SBL OSPI logs? I have attached a sample reference:

    If the red highlighted part is fine, we at least confirm that SBL is working fine, then we your application is in infinite while loop, you can just connect to your core, halt the processor and see the code stuck in loop (this should be possible since the code is copied from Flash and executing from RAM).

    Regards,
    Shaunak

  • My question is: how do I boot up a multi-core environment? Is the example ospi_sbl_multicore_elf  sufficient for booting a multi-core system?

    Regards

    Shashank B

  • Hi Shashank,

    Please understand it this way. After power-reset, the ROM will load SBL (sbl_ospi_multicore_elf in this case). The SBL will then load your application image. This flow stays the same for single/multi-core environment. The application image uses .mcelf format (which is a combined binary of all the cores you are using, be it single or multi-core environment).

    The SBL will only do the required initializations on the SOC and then attempt to load and boot up the application image you have flashed.

    So the SBL OSPI MULTICORE ELF is sufficient for booting a multi-core system, but you also need to have your application flashed at the 0x81000 offset for the SBL to boot the application image.

    https://software-dl.ti.com/mcu-plus-sdk/esd/AM263PX/latest/exports/docs/api_guide_am263px/EXAMPLES_DRIVERS_SBL_OSPI.html

    Rom bootloader explained in detail: https://dev.ti.com/tirex/explore/content/am26x_academy_10_02_00_03/_build_am26x_academy_10_02_00_03/source/boot/top_level_boot_flow.html

    SBL explained in detail: https://dev.ti.com/tirex/explore/content/am26x_academy_10_02_00_03/_build_am26x_academy_10_02_00_03/source/boot/secondary_boot_flow.html

    I loaded the multicore environment into OSPI using UniFlash, but it does not boot

    I want to know what exact "failure/issue" you face.

    Make sure you select the sbl_ospi_multicore_elf .tiimage as well as application .mcelf image when flashing using uniflash.

    1. Do you see any error pop up in the UniFlash tool when flashing?

    2. Do you see any error in the logs when you try to power cycle and run the application?

    I hope you are referring to the documentation for flashing: https://software-dl.ti.com/mcu-plus-sdk/esd/AM263PX/latest/exports/docs/api_guide_am263px/TOOLS_FLASH.html#TOOLS_TI_UNIFLASH_TOOL

    (do not select the XIP file unless you have XIP configured in your application for running from flash instead of RAM, just the SBL and Application image should be enough).

    For example, if you flash a hello world application, you will see the SBL OSPI logs and then the hello world application logs if everything boots up correctly.

    Regards,
    Shaunak

  • Hi Shaunak,

    How are the HSMRT project and the HSMRT SBL project created? In the R5F SBL, we are loading an HSM image—what exactly is this? Is it the HSM runtime application or the HSM SBL?

    Additionally, in HS-SE mode, do we need to develop our own SBL for the HSM, or is it provided?

    Regards,

    Shashank B,

  • Hi Shashank,

    Additionally, in HS-SE mode, do we need to develop our own SBL for the HSM, or is it provided?

    For HS-SE devices, please download and use the TIFS SDK. You can use the TI Provided SBLs, sign them with the keys you would've programmed when converting your device from HSFS -> HSSE. You don't need to develop the whole SBL, just make sure you sign with correct keys.

    How are the HSMRT project and the HSMRT SBL project created? In the R5F SBL, we are loading an HSM image—what exactly is this? Is it the HSM runtime application or the HSM SBL?

    HSMRT firmware provides various foundational security services to the R5F core. You do not need to build this project/create it. You can use the SDK projects/images. There is no concept of "HSM SBL". In context of R5F core, you just load "HSMRT" firmware which is provided as a ".h" file in the SDK.

    For more details about the services of HSMRT, please refer: https://software-dl.ti.com/mcu-plus-sdk/esd/AM263PX/latest/exports/docs/api_guide_am263px/SECURITY_PAGE.html

    https://software-dl.ti.com/mcu-plus-sdk/esd/AM263PX/11_00_00_19/exports/docs/api_guide_am263px/hsmclient_8h.html

    Regards,
    Shaunak

  • Hi Shaunak,

    While trying to import projects from the TIFS_AM263Px SDK, I am unable to load the project in CCS. It shows an error stating that MCU_PLUS_SDK_AM263Px v0.0 is not downloaded, even though I have MCU_PLUS_SDK_AM263Px_10_02_00_15 installed in the TI folder on my PC.While trying to import projects from the TIFS_AM263Px SDK, I am unable to load the project in CCS. It shows an error stating that MCU_PLUS_SDK_AM263Px v0.0 is not downloaded, even though I have MCU_PLUS_SDK_AM263Px_10_02_00_15 installed in the TI folder on my PC.

    Regards,

    Shashank B,

  • Hi Shashank,

    Can you try this:

    1. In any code-editor (like VS code, or even notepad), open the example.projectspec file for whichever example you are using.

    2. Search for 
    products="sysconfig;com.ti.TIFS_AM263PX;com.ti.MCU_PLUS_SDK_AM263PX;"

    3. Replace it with:
    products="sysconfig;com.ti.TIFS_AM263PX;MCU-PLUS-SDK-AM263PX;"

    4. Save the file, try to re-import in CCS.

    Regards,
    Shaunak

  • Shaunak,

    While building the project, I encounter the following error:

    Regards,

    Shashank B

  • Hi Shaunak,

    1. While debugging the OSPI SBL code, I added an infinite while loop at the beginning of the SBL main() function, controlled by a variable that can be manually changed. After flashing the ospi_sbl image into OSPI flash, setting the device to DevBoot mode, and applying a power-on reset, I loaded the symbols in CCS—but CCS reports that the execution is out of program.

    2. What is the difference between the OSPI_SBL and OSPI_SBL_MULTICORE_ELF examples? Both appear to be capable of loading multiple cores.

    Regards,

    Shashank B

  • Hi Shaunak,

    • The first issue was resolved by changing the boot mode pins to OSPI boot mode. However, the CCS  in-to function debugging is not working properly, even though I have enabled DEBUG_ENABLE in the devconfig.mak file.

    • Please confirm if my understanding is correct:

      • OSPI_SBL loads RPRC images (compact, loadable, intermediate format, and can be combined for multicore images).

      • OSPI_SBL_MULTICORE_ELF loads a multicore ELF images, which is a direct MCELF .out file.

    • Which method do you recommend for loading multicore images — MCELF (multicore ELF) or RPRC images?

    Regards,

    Shashank

  • The first issue was resolved by changing the boot mode pins to OSPI boot mode. However, the CCS  in-to function debugging is not working properly, even though I have enabled DEBUG_ENABLE in the devconfig.mak file.

    For debugging SBL, you don't really need to have DBG_ENABLE, unless you are using HSSE device, i believe you are using HSFS device right?

    Usually, as soon as the ROM hands off the control to SBL, you should enter the while loop setup at the top of the entry in SBL and when connecting a debugger, (HSFS device should be able to connect directly), you can see the code, exit the loop and debug normally.

    • Please confirm if my understanding is correct:

      • OSPI_SBL loads RPRC images (compact, loadable, intermediate format, and can be combined for multicore images).

      • OSPI_SBL_MULTICORE_ELF loads a multicore ELF images, which is a direct MCELF .out file.

    • Which method do you recommend for loading multicore images — MCELF (multicore ELF) or RPRC images?

    Id recommend using SBL OSPI Multicore Elf since RPRC format is deprecated and mcelf format is the default format in the SDK

    Regards,
    Shaunak