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.

CCS/TMS570LC4357: When using Ti Safety Library, DSP reboot two times when power up

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

Tool/software: Code Composer Studio

Hi,

    When I using safety lib to finish diagnosis, the TMS570LC4357 reboot form APP to BOOT two times after power up, which takes my initial time。

It goes just as :power up->boot->app->boot->app->boot->app->application

I debug in CCS, and I found every time DSP jump to boot after finish SL_Init_R5Registers function, When I use demo project generated by halcogen , there is no reboot, so I compare the difference between demo project and safety lib resource.

The compare result as follow, demo project use _coreInitRegisters_ function to initiate cpu in hl_startup.c while safety lib resource using SL_Init_R5Registers function.

It seems there is a bug in front and end of  SL_Init_R5Registers,  it makes  lr register initiate to 0 afterfinish  SL_Init_R5Registers function, so the ARM kernel  reboot from BOOT _c_int00.

So I changed the code MOV R0, LR in front of SL_Init_R5Registers function and BX R0 in end of SL_Init_R5Registers function,and it works good and there is no reboot to BOOT.

The question is : Is this a bug? and am I take the right measure to avoid this problem?

 

thank you.

  • Hi,

    You are correct - this is a bug in the SL_Init_R5Registers() routine. The intention was to mimic the coreInitRegisters() function as-is, even while using the safeTI library. I will file a bug report for this.

    Regards, Sunil

  • I misspoke in my earlier post. The link register for Supervisor mode is not overwritten to 0. The LR is initialized for all other modes only. The init registers routine does switch the CPU mode back to Supervisor mode before executing the "BX LR" instruction, so the CPU must branch back to the correct address and not 0.

    Regards, Sunil

  • Thanks Sunil,

    Before first  BX LR,the LR is 0x14c40

    Befor second BX LR, the LR is 0x14c44

    Before third BX LR, the LR is 0x8eb28, it's correct address to jump, so it work normally after reboot two times.

    so I correct the bug and branch to R0 which record LR's value:0x8eb28.