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.

TMS570LS1227: MPU resets after erasing bootloader

Part Number: TMS570LS1227

Hi,

I am trying to update bootloader code from the main app. Before erasing the bootloader flash sectors, I disable all interrupts and enable them again after erasing the bootloader flash sectors. However, the MPU resets when it tries to send command over I2C. The debugger first says "running" then "running - a reset occured" and "running" again, When I suspend the code, it says "break at address 0x4 with no debug information available, or outside of program code."

I2C and some other peripherals use DMA.


Another thing is that, when I erase the whole flash and load only the main app, it crashes as soon as it sends the first I2C command.
For some reason the main app needs the data in the first sector.
What causes this problem?


Below you can find the linker file content:

MEMORY
{
	VECTORS (X)  : origin=0x00060000 length=0x00000020 vfill = 0xffffffff
	FLASH0  (RX) : origin=0x00060020 length=0x000DFFE0 vfill = 0xffffffff
	STACKS  (RW) : origin=0x08000000 length=0x00001500
	RAM     (RW) : origin=0x08001500 length=0x0002EB00
}

SECTIONS
{
    .intvecs : {} > VECTORS
    flashAPI:
   {
     .\source\Fapi_UserDefinedFunctions.obj (.text)
     .\App\source\bl_flash.obj (.text)
     --library= "c:\ti\Hercules\F021 Flash API\02.01.01\F021_API_CortexR4_BE.lib" (.text, .data)
   } palign=8 load = FLASH0, run = RAM, LOAD_START(apiLoadStart), RUN_START(apiRunStart), SIZE(apiLoadSize)

    .TI.ramfunc : {} load = FLASH0, run = RAM, LOAD_START(ramLoadStart), RUN_START(ramRunStart), SIZE(ramLoadSize)

    .text    : {} > FLASH0
    .const   : {} > FLASH0
    .cinit   : {} > FLASH0
    .pinit   : {} > FLASH0
    .bss     : {} > RAM
    .data    : {} > RAM
    .sysmem  : {} > RAM
}

Regards,
Cihan

  • Hi Cihan,

    I don't understand your issue clearly. I don't understand what is i2c role here, why we are sending commands over i2c? what type of commands they are?

    Please provide more details about the issue.

    --

    Thanks & regards,
    Jagadish.

  • Hi Jagadish,

    In our system there are several I2C devices like EEPROM, temperature sensor, LED controller that the main app sends data periodically.
    The problem as far as I understood is that when the first page is erased, the I2C peripheral fails and MCU reset occurs. For some reason the MCU wants to access the first page where bootloader resides.

    Regards,
    Cihan

  • Hi Cihan,

    Is it possible to you to send your complete project?

    You can even send the project in private chat as well.

    --

    Thanks & regards,
    Jagadish.

  • Hi Jagadish,

    Unfortunately I can't send the complete project but I can prepare a minimal project for you.

    Another thing I noticed is that I can reproduce the same issue without erasing the bootloader in the main app. What I did was, I just used the same linker file I posted above and in CCS I set "Entire Flash" in Debug->Flash Settings-> Erase Options. Then I ran the code in CCS by clicking Debug button and after the code sent the first I2C command, it crashed.

    Regards,
    Cihan

  • Hi Cihan

    Unfortunately I can't send the complete project but I can prepare a minimal project for you.

    This would be great.

    What I did was, I just used the same linker file I posted above and in CCS I set "Entire Flash" in Debug->Flash Settings-> Erase Options. Then I ran the code in CCS by clicking Debug button and after the code sent the first I2C command, it crashed.

    Understood. Please try to send a minimal project so that i can reproduce the issue at my end.

    --

    Thanks & regards,
    Jagadish.