Because of the Thanksgiving holiday in the U.S., TI E2E™ design support forum responses may be delayed the week of November 23.

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.

TMS570LC4357-SEP: Understanding TMS570LC4357-SEP Boot Image

Part Number: TMS570LC4357-SEP
Other Parts Discussed in Thread: TMS570LC4357, HALCOGEN

Hello,

I am designing a PCB with a TMS570LC4357-SEP device.  I understand that this device boots from internal flash by default at power-up.  In this application, I would like to have multiple copies of this boot image, in case the original image gets corrupted.  This is early in development, and I am not sure if the internal flash will be large enough for multiple copies of the boot image will fit in the internal flash.

I am attempting to add additional, external, non-volatile memory for this device as a way to ensure I have enough space for multiple boot images.  I am currently planning to use a SPI interface for this additional memory device.

My questions are:

1) Is there any way to have the TMS570LC4357-SEP boot from extrernal memory over any of its SPI interfaces?  If so, I could fit multiple images in the external non-volatile memory device.

2) Is there any way to select a specific location in the internal flash from which to boot?  In case I can fit multiple images in the internal flash, how could I have the TMS570LC4357-SEP device "fail-over" to a second image if the first image is corrupted?

3) If address 0 of internal flash is the only place that I can boot from, is there any way that I could reprogram the flash from an external non-volatile memory device in case the internal flash is corrupted?  In this case, I would like to reprogram the corrupted image in some way.

Thanks!

  • Hi Cameron,

    1) Is there any way to have the TMS570LC4357-SEP boot from extrernal memory over any of its SPI interfaces?  If so, I could fit multiple images in the external non-volatile memory device.

    No — the TMS570LC4357 does not natively support booting directly from an external SPI device.

    The TMS570LC4357 is a safety-critical ARM Cortex-R5F based MCU. Its boot ROM is hardwired to fetch the reset vector and begin execution from the internal flash memory (mapped at address 0x00000000).

    2) Is there any way to select a specific location in the internal flash from which to boot?  In case I can fit multiple images in the internal flash, how could I have the TMS570LC4357-SEP device "fail-over" to a second image if the first image is corrupted?

    Not directly via hardware — but it can be implemented in software.

    The TMS570LC4357 always begins execution at the reset vector located at the beginning of internal flash (address 0x00000000). You cannot configure the hardware to boot from a different flash address without software intervention.

    Flash Layout Example:

    Region
    Address Range
    Contents
    Bootloader
    0x00000000
    Small failover bootloader
    Image A
    0x00020000
    Primary application image
    Image B
    0x00100000
    Backup application image

    The TMS570LC4357 has 4 MB of internal program flash, which is substantial. Depending on your application image size, fitting two copies plus a bootloader is very feasible.

    3) If address 0 of internal flash is the only place that I can boot from, is there any way that I could reprogram the flash from an external non-volatile memory device in case the internal flash is corrupted?  In this case, I would like to reprogram the corrupted image in some way.

    Recommended approach:

    1. Store a "golden" recovery image on the external SPI NVM.

    2. The bootloader (at 0x00000000) checks image integrity at every boot. If both Image A and Image B in internal flash are found to be corrupt:

      • The bootloader initializes the MibSPI peripheral.
      • It reads the recovery image from the external SPI NVM.
      • It uses the Flash API (provided by TI as part of the HALCoGen/F021 Flash API library) to erase and reprogram the corrupted internal flash sectors.
      • After successful reprogramming and CRC verification, it resets the device to boot from the newly written image.
    3. TI's F021 Flash API is the standard mechanism for in-application programming (IAP) of TMS570 internal flash. It supports erase, program, and verify operations from user code running in RAM or a separate flash bank.

    --
    Thanks & regards,
    Jagadish.

  • Hello,

    Thanks for this explanation! 

    This approach seems more reliable, but still not completely bullet-proof.

    If a portion of flash memory in the area of the bootloader image (starting at address 0x00000000) is corrupted with a double-bit error, wouldn't that stop the boot process completely next time the device attempts to boot?  That is my main concern with the bootloader approach.  Is there any way to prevent a double-bit error in the bootloader from turning the whole system into a brick? 

    I believe a single-bit error would be corrected by EDAC, and could be cleaned up by software after the boot completes.

    Regards,

    -Cameron

  • Hi Cameron,

    On the TMS570LC4357, the internal flash has ECC protection on every 64-bit data word (using an 8-bit ECC code):

    • Single-bit errors (SBE): Automatically corrected in hardware — transparent to the CPU.
    • Double-bit errors (DBE): Cannot be corrected — the flash controller signals a fault to the ESM (Error Signaling Module).

    If a DBE occurs while the CPU is fetching instructions from the bootloader region (0x00000000), the ESM will assert a Group 3 error, which triggers nERROR pin of the controller.

    As highlighted here Group 3 errors will always trigger nERROR pin and no configuration is required, so if there is a flash double bit error at 0x00000000 that will also trigger the nERROR pin and we can know there is a critical error in the controller.

    --
    Thanks & Regards,
    Jagadish.