Hello
@danielmartynek,
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 which currently, I am using for injection of stack overflow.
*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