Good morning,
we are beginning to integrate into our project the safety diagnostic library ver 2.2.0. The demo project TMS570LS3137_NoOS has been built and run correctly. Then we added the safety diagnostic library to our project that worked fine but now this project doesn't works .
We compared using 2 devices with the debugger where was the problem, on device 1 we have loaded demo project and on device 2 we have loaded the our project with safety library, we found the following error:
1- we have copied from demo the following file: all 'hal/' directory, all 'safety_library/' directory, the file 'esm_application_callback.h' and 'register_readback.h' from 'common/include/' directory, the file 'esm_application_callback.c', 'exception_handlers.c', 'misc.asm' and 'register_readback.c'. From 'HALCoGen/TMS570LS3137_NoOS/source/' directory we replaced the files 'sys_startup.c', 'sys_selftest.c', 'system.c', 'sys_intvecs.asm' the othes are the same. We changed the linker file like 'SL_TMS570LS3137_NoOS_sys_link.cmd'. We has been built the project.
2- the error occurs during the call:
retVal = SL_SelfTest_SRAM(SRAM_ECC_ERROR_FORCING_2BIT, TRUE, &failInfoTCMRAM);
in particular, at line 234 of the function SL_SelfTest_SRAM:
SL_FLAG_SET(SRAM_ECC_ERROR_FORCING_2BIT);
following the source C code:
boolean SL_FLAG_SET(sint32 flag_id) {
sl_priv_flag_set[flag_id-TESTTYPE_MIN] = TRUE;
return sl_priv_flag_set[flag_id];
}
3 - in function SL_FLAG_SET when return the program jump to _excpt_vec_abort_data, in particular when we execute the assembler instruction
ldrb r0, [r0, r12]
following the Disassembly:
return sl_priv_flag_set[flag_id];
0003f980: E59F03EC ldr r0, [pc, #0x3ec]
0003f984: E59DC000 ldr r12, [sp]
0003f988: E7D0000C ldrb r0, [r0, r12]
then the program crashed and jump to _excpt_vec_udef_instr, in the infinite loop.
We have debbuged also the demo project performing the same lines of code, but this error does not happen.
Do you have an idea about what we might have been wrong?
Thank you & Best Regards