Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

TMS570LS3137: Processor Error when Interrupt triggers during memset

$
0
0

Part Number:TMS570LS3137

So I have an memset which is zeroing a large struct (~3900 bytes). If an interrupt (specifically in this case a GIO interrupt triggered by an external device interrupt line connected to GIOB[X], triggering every few ~4 milliseconds) happens during the memset (usually after the TST command - see below). The easiest way to get the error is to step through the assembly and thus the interrupt would trigger between each step. Also able to get it if you put a while loop around the memset which will cause the issue to trigger at a higher rate than not looping around it.

 

I have read that when the interrupt triggers some data the memset is using may get overwritten and that is what causes the error. I have worked around the issue by using a for loop instead of the memset which seemed to have fixed the error. Any additional information regarding the memset error would be appreciated.

 

__TI_MEMSET:	.asmfunc stack_usage(20)
	PUSH	{R0, R4, R5, R6, LR}	; save R0 also since original dst
					; address is returned.

	TST	R0, #3			; check for word alignment
	BEQ	_word_aligned

void initializeStruct(MyStruct * const ptr)
{
    memset(ptr, 0x00, sizeof(MyStruct));
}


#pragma CODE_STATE(gioLowLevelInterrupt, 32)
#pragma INTERRUPT(gioLowLevelInterrupt, IRQ)
void gioLowLevelInterrupt(void)
{
    uint32_t offset = gioREG->OFF2;

/* USER CODE BEGIN (17) */
/* USER CODE END */

    //if (offset != 0U)
    //{
    //    offset = offset - 1U;
    //    if (offset >= 8U)
    //    {
    //        gioNotification(gioPORTB, offset - 8U);
    //    }
    //    else
    //    {
    //        gioNotification(gioPORTA, offset);
    //    }
    //}

    gioREG->FLG = 0xFF; // Clean the GIO Interrupt flag register

/* USER CODE BEGIN (18) */
/* USER CODE END */

}

I would just like additional details on the cause of the issue.

Thanks,

David Cothran


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>