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.

TMS320F280049C: Jumping issue in TMS320F280049C Boot loader

Part Number: TMS320F280049C

Tool/software:

Hi,

I'm working on a custom boot loader for the TMS320F280049C. Here's how my memory map is structured:

- Boot loader: 0x80000 – 0x81FFF
- Application Sector1 (Primary): 0x82000 – 0x8FFFF
- Application Sector2 (Backup): 0x90000 – 0x9DFFF

The boot loader supports dual-bank updates for backup recovery.

Problem Description:
If a power loss occurs while updating Sector1 — specifically after the erase step but before programming completes — :
- After power on boot loader detects the dual sector version numbers,
- Proceeds to jump to Sector2 at 0x90000.


**However**, during the jump to Sector2, a **continuous watch dog reset** occurs. The watchdog is already disabled, and the jump function is properly casting a function pointer to 0x90000.


Interestingly, if a power-off occurs during a Sector2 update, the boot loader can successfully fall back to Sector1 with no reset issue. But something tied to the system state when Sector1 is erased.

Observations :
- Verified that the application code in Sector2 is present and valid using CCS memory view.
- Jump logic checks pass and the call is made.
- After the jump attempt, the ECU resets repeatedly.

My Questions:
- What are the recommended steps to safely jump from the boot loader to a backup application located at 0x90000?
- How can I prevent this reset loop?

Has anyone encountered this?


Any suggestions or examples for proper jump context handling would be greatly appreciated.

  • Hello,

    When you're upgrading the primary application (which resides in the same flash bank as the bootloader), are you executing the bootloader from RAM? If you cut power during flash programming, it could potentially leave the flash bank in a corrupt state.

    When the bootloader erases/programs the application, it should be resident in RAM because simultaneous reads-from/writes-to flash are not possible. Not all of the bootloader runs from RAM, only a portion of it. Please refer to the .TI.ramfunc section.

    Please also share your linker command files for all applications and the bootloader.

    Best,

    Matt

  • Hi,

    Apologies for the delayed response, and thank you for your support.

    I understood your point:

    1.The Flash API and flash initialization functions are copied to RAM at the beginning, before trying to jump to any application code.

    2.Cutting power during flash programming in sector1 ,can leave the flash bank in a corrupt state. But I have a doubt here — why does this corruption not happen when power is cut after flashing in sector1 (before verification) is complete?

    In my case, after flashing in sector1, if I cut power, the system still boots correctly — even jumping to the backup version (sector2) if needed. But when I cut power after erase and before programming complete in sector1, it fails jumping to the backup version (sector2)(since the sector is empty or not fully flashed).

    Could you please help me understand why corruption doesn’t occur post-flashing in sector1 but causes issues when power is lost after erase and before flashing completes in sector1?

    If a power-off occurs during a Sector2 update (at any phase), the boot loader can successfully fall back to Sector1 with no reset issue. 

    Could you help me understand this behavior?

    • Why does it jump to sector2 when sector1 has valid code?

    • And why does it not jump to sector2 when sector1 is empty or not fully flashed?

    Here's how my memory map is structured:

    - Boot loader: 0x80000 – 0x81FFF (Bank1)

    - Application Sector1 (Primary): 0x82000 – 0x8FFFF (Bank1)

    - Application Sector2 (Backup): 0x90000 – 0x9FFFF (Bank2)

    Would really appreciate some clarification on this scenario.

    Regards,

    Sravani

  • Hello Sravani,

    Corruption happens if there is power loss before it finishes programming the flash. Flash programming requires applying a certain voltage to the flash cells for a period of time, if this is interrupted then it can't be guaranteed that the flash will be programmed correctly. The reason we don't see that corruption after power loss when programming has been completed is the flash cells have already been written at that point. 

    Best,

    Matt

  • Hi,

    Thank you for your support.

    I previously had my boot loader and main application in Bank 0, and I observed that if power loss happened during flash programming in Bank0, the system failed to jump to backup sector(Bank1) — which I understand is expected due to Bank 0 corruption as you said.

    To improve this, I moved:

    • Boot loader to Bank 1 (0x90000)

    • Main application remains in Bank 0 (0x82000)
    • Backup application to Bank 1 as well (0x92000)

    During initial boot loading, I flashed only the  application code  at 0x92000 (Bank1). If there’s a power loss during programming (before it's fully written), then upon reset, the boot loader tries to jump to the Back up application (Bank0), and it worked correctly, as expected.

    The issue arises during the second time I try to flash Sector 1 (0x82000):
    If there’s a power loss during programming (before it's fully written), then upon reset, the boot loader tries to jump to the Back up application (Bank1), and it fails. It does not jump to the backup application at 0x92000 (Bank1), even though it is still valid. Continuous  reset occurs while trying to jump to backup sector(Bank1).

    Now, even though the boot loader no longer resides in Bank 0 (Corrupted bank), I still face the same issue

    Thanks in advance for your clarification and suggestions!

    Regards,

    Sravani

  • Hello,

    The expert will be out of office until 7/3, please expect a response back by then.

    Thank you,

    Luke

  • Hello,

    How are you branching to your backup application in the bootloader? Can you share the linker command files for the Bank 0 and Bank 1 applications and the bootloader?

    Best,

    Matt

  • Hi,

    Since there have been no replies in a month, I will assume the issue is resolved and close the thread.

    Best,

    Matt