Part Number: TM4C129DNCPDT
Tool/software:
Hello,
Working with TM4C129DNCPDT microcontroller with TI RTOS. Want to implement the NMI handler for my application.
Using the GPIOD - GPIO7 - NMI handler
Following is the code,
GPIO initialization:
_Bool initPortD(void)
{
uint8_t InitTry = 0;
do
{
MAP_SysCtlPeripheralEnable( SYSCTL_PERIPH_GPIOD);
if (InitTry++ >= PERIPHERAL_INIT_TRY_TIMES)
{
return __FAIL;
}
appSystemDelay(SYS_DELAY);
}
while (!MAP_SysCtlPeripheralReady(SYSCTL_PERIPH_GPIOD));
MAP_GPIOPinTypeDIVSCLK(GPIO_PORTD_BASE,GPIO_PIN_7);
MAP_GPIOPinTypeGPIOOutput(GPIO_PORTD_BASE, GPIO_PIN_5 | GPIO_PIN_1);
MAP_GPIOUnlockPin(GPIO_PORTD_BASE, GPIO_PIN_7);
MAP_GPIOPinTypeGPIOInput(GPIO_PORTD_BASE, GPIO_PIN_7);
HWREG(GPIO_PORTD_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY;
HWREG(GPIO_PORTD_BASE + GPIO_O_CR) |= GPIO_PIN_7;
HWREG(GPIO_PORTD_BASE + GPIO_O_LOCK) = 0;
GPIOPinConfigure(GPIO_PD7_NMI);
IntRegister(FAULT_NMI, nmiHandler);
IntEnable(FAULT_NMI);
return __PASS;
}
// NMI handler
void nmiHandler(void)
{
MAP_GPIOIntClear(GPIO_PORTD_BASE, GPIO_PIN_7);
nmiFlag = true;
GPIOPinWrite(GPIO_PORTM_BASE, GPIO_PIN_3, GPIO_PIN_3);
}
The above is the code.
While debugging the function
__attribute__((section(".text:abort")))
void abort(void)
{
#if defined(EMBED_CIO_BP)
__asm(" .global C$$EXITE");
#if defined(__32bis__)
__asm("C$$EXITE:.word 0xDEFED0FE");
#else
__asm(" .align 4");
#if defined(__big_endian__)
__asm("C$$EXITE:.half 0xDEFE");
#else
__asm("C$$EXITE:.half 0xD0FE");
#endif /* __big_endian__ */
#endif /* __32bis__ */
#else /* !EMBED_CIO_BP */
__asm(" .global C$$EXIT");
__asm("C$$EXIT: nop");
#endif
for (;;); /* SPINS FOREVER */
}
Kindly assist how to resolve the Issue. Is that possible to notify the NMI occurrence via UART?
Thanks in advance.

