Tool/software: Code Composer Studio
I use TMS570LC4357. I have questions about HL_sys_startup.c code.
I want to use Ti Safety library. But I show this code.
/* Check if there were ESM group3 errors during power-up.
* These could occur during eFuse auto-load or during reads from flash OTP
* during power-up. Device operation is not reliable and not recommended
* in this case. */
if ((esmREG->SR1[2]) != 0U)
{
while(1); //ESM group3 error
}
I find the this problem occurrred when power on/off frequently. So, i do power on/off again to react the chip.
Moreover, I find this code is used to every firmware which is generated by HAlCoGen (it means default code).
It is impossible to reboot by this error, when this chip is used in product. I want to know more detail about this problem.
1. Why this problem is occurred?
- I understand the some peripharal power sequence is distorted sometimes. It is occurred in hardware. Is it impossible to block this problem?
2. When this problem is occurred, why do hardware reset?
- if the firmware is boot up as ignored this problem, what problems can happen?
3. When this problem is occurred, it is no problem that just do reset by software.
- I pass the error by reset which based on Ti safety library. Would you confirm this way is alright?
* HL_sys_startup.c file / GREEN color is new inserted code
(1) In _C_int00 function
resetReason = SL_Init_ResetReason();
switch(resetReason)
{
case RESET_TYPE_POWERON:
case RESET_TYPE_DEBUG:
case RESET_TYPE_EXTRST:
case RESET_TYPE_EXTRST_NERROR:
case RESET_TYPE_SWRST:
......
systemInit();
if ((esmREG->SR1[2]) != 0U) {
resetReason = RESET_ERROR;
}
....
break;
// switch function finish
....
if((RESET_TYPE_DEBUG != resetReason) && (RESET_ERROR != resetReason))
(2) in after_STC function
_cacheEnable_();
/* USER CODE BEGIN (24) */
/* USER CODE END */
/* USER CODE BEGIN (25) */
debug_printf( "reset type = %d \n\r",resetReason);
if (resetReason == RESET_ERROR){
debug_printf("\033[1;31mSystem Failure detected - Power Sequence error\n\rError cannot be cleared(keep going)\n\r\033[m");
//regulator enter the active state and reset will be caused by error forcing
systemREG1->SYSECR |= ((uint32)0x03u<<14);
}
/* USER CODE END */
/* initialize global variable and constructors */
__TI_auto_init();
Regards,
Minwoo