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.

question about safety init

Other Parts Discussed in Thread: HALCOGEN

Hi,Ti:

My project is running ok when there are not  "safety init".

But ,after I enable "safety init" with HAL Code Generator,My project will  suspend at sys_startup.c.

It stop at there ,behind with red mark.

Please tell me why?

How can I do ?

if ((esmREG->SR1[2]) != 0U)
{
/* USER CODE BEGIN (24) */
/* USER CODE END */
/*SAFETYMCUSW 5 C MR:NA <APPROVED> "for(;;) can be removed by adding "# if 0" and "# endif" in the user codes above and below" */
/*SAFETYMCUSW 26 S MR:NA <APPROVED> "for(;;) can be removed by adding "# if 0" and "# endif" in the user codes above and below" */
/*SAFETYMCUSW 28 D MR:NA <APPROVED> "for(;;) can be removed by adding "# if 0" and "# endif" in the user codes above and below" */
for(;;)
{
}/* Wait */

  • Hi Yenfung,

    I see two main Reasons to get stuck here

    1) ESM group 3 error is set before you do system Init. ie., Error was set even before you started _c_int00(). This could be because of the code that was executing earlier set this error, but never cleared or serviced. Just a guess, Probably you could have disturbed one of Selftest in the middle and tried to reload a new code.. 
    2)  This can happen if you have not programmed the Flash ECC locations, hence ESM Group 3 error would have set.

    Note:

    1) When you are using the safety Init functions during startup, it generates errors intentionally and clears them, if every thing goes fine by the time you reach main, everthing should be clean and no errors introduced during selftests would should remain. 
    2) CCM Self test can be run only in non - Debug Mode. i.e., No Debug tools should be connected. So you download the code, disconnect the debugger and do reset / power cycle to run the code. That's the reason by default it is disabled in HALCoGen.
    3)  For your problem, try power cycle once and see. If still it gets stuck at the routine, Send me the ESM Group2 Error Status register ( (esmREG->SR1[2]) value. 

  • the value of esmREG->SR1[2] is 0x000008;

    I want to know if my program need to do something when I enable "safety init".

    Now,I only enable "safety init" at HAL Code Generator.

    My app program don't work when it is not debug

    I have power again.

  • Hi Yunfeng

    Can you send your code, Looks like you have RAM ECC double bit error. Which actually you will not get unless you Enable RAM ECC which is done after the the code "if ((esmREG->SR1[2]) != 0U)".

    Just for Debug purpose can you disable CCM self test, generate code, Download the code, Power cycle ( to clear ESM erro if it was alreadt set) and try excuting.

    I cannot commnet unless i see the code. Which device are you suing, Are you using CCS for debug?

  • Please see at attachment ,Thanks

    ls.rar
  • TI:

    I have  confirmed  the cause of no work,  

    It because that I select  "enable flash ecc check " and "enable esram ecc check"

    When I select above two options , my app will not work

    When I did not select above two options ,my app will work normally.

    Why?

    Thank you!

  • Hi

    Still I waiting to get a working KEIL licensing setup working at my desk. 

    I am not sure if Flash ECC location has been programmed in your micro. I would recommend you to installnowecc tool from below link. Give your executable as input to the tool and get the ECC appended to the executable, then download it to the micro. If there is a postbuild option in KEIL you can configure them too. 

    Please refer the user guide for more details how to use it. 

    http://www.ti.com/tool/nowecc

    Something similar to this 

    For TMSxxx Devices
    ------------------
    “<nowECC path>\nowecc.exe” -F021 16M_ADD -R4 -a YOUR Executable
    For RMxxx Devices
    -----------------
    “<nowECC path>\nowecc.exe” -F021 16M_ADD -le -R4 -a YOUR Executable

    Regards
    Prathap