Failure Recovery reaction of S32K3XX from Stack Overflow

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Failure Recovery reaction of S32K3XX from Stack Overflow

918 次查看
raj12
Contributor III

Hello,

I am injecting the stack overflow error of S32K3XX MCU, and after successfully injection of error DebugMon_Handler exception triggering.

I have a query Related to recovering methods. during testing observed only After power on reset MCU is able to recover from Stack Overflow exception.

Please let me know is there any other methods of recovery.
Thanks

标记 (2)
0 项奖励
6 回复数

495 次查看
lstudley
Contributor I

Hello, I would also like to know more of how to mitigate this.
BR, Lee CirrusAircraft Engineer

0 项奖励

558 次查看
antoinedubois
NXP Employee
NXP Employee

HI Raj,

I have been discussing this query with our SW team and there is debate if such type exception handler as the cause of failure would be detected by lockstep, SCST or prevented for systematic fault.

Some exception handlers are tested as part of our SAF Schecks or SCST.

Can you tell me the strategy and safety requirement you are trying to achieve and I can refine the method we are using (or if we think it is necessary or not).

Best regards,

Antoine

0 项奖励

530 次查看
raj12
Contributor III
Hello @mr antoinedubois,

Thanks for your reply.

I want to capture the stack overflow/underflow error. So, once it will come, we will be able to capture the error.
it is completely part of application.

Thanks,


0 项奖励

656 次查看
antoinedubois
NXP Employee
NXP Employee

Hi Raj, I just wanted to let you know I am still investigating this query with the SW team. Sorry for the delay, this is not a straightforward answer.

Antoine

0 项奖励

891 次查看
antoinedubois
NXP Employee
NXP Employee

Hi Raj12,

it may depend on the way you inject the stack overflow error. I would need a bit more details to understand how you are injecting the faults, and the reaction you are seeing.

Could you share pseudo code, or diagram.

 

0 项奖励

874 次查看
raj12
Contributor III
Hello @antoinedubois,

Thanks for your reply.

Now, I am now able to recover from stack overflow error after doing the functional reset.

Below is the pseudo code
*DEMCR_reg = (1 << 24) | (1 << 16);
/* Get implemented values for num of comparators in DWT registers*/
numcomp = (DWT->CTRL & (0xF << 28)) >> 28;

DWT->NUMCOMP[0].COMP = (uint32_t)stackPointer - (1016 * sizeof(uint32_t));
DWT->NUMCOMP[0].MASK = 0;
DWT->NUMCOMP[0].FUNCTION = 0x7;
DWT->NUMCOMP[0].FUNCTION &= ~((1 << | /* Perform address comparison */
(1 << 7));
for (counter = 0, reg0 = 0; counter < 1016; counter++, reg0++)
{
__asm("PUSH {r0}");
}

Can you please let me know the other method to inject the stack over flow error.

because, I not want to use below variable there is some limitation on GHS compiler not allowing me to save the stack pointer (__asm("SP")) in register type variable.

register uint32_t* stackPointer __asm("sp");

Please let me know the other method for injecting the stack overflow/underflow error error it will be helpful for my development.

Thanks