Hi,
I am using my custom board and I want to use HWI on TM4C123BH6ZRBI. For this I am configuring SPI for EOT interrupt which will be set when the last bit is transfered from the master.
Here is my code snippet(only the relevant code)---
void GPIO_SSI_ISR(UArg instance)
{
// Clear the End of transmission Interrupt bit
//
HWREG(SSI2_BASE + SSI_O_ICR) |= SSI_TXEOT;
// Event posted to Thread waiting for End of transmission Interrupt
Event_post( evSSIHandle, Event_Id_00);
}
int main()
{
......
//
// Board Initialization
//
ROM_SysCtlClockSet(SYSCTL_SYSDIV_2 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |SYSCTL_XTAL_16MHZ);
.......
......
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA|SYSCTL_PERIPH_GPIOB|SYSCTL_PERIPH_GPIOC|
SYSCTL_PERIPH_GPIOD|SYSCTL_PERIPH_GPIOE|SYSCTL_PERIPH_GPIOF|
SYSCTL_PERIPH_GPIOG|SYSCTL_PERIPH_GPIOH|SYSCTL_PERIPH_GPIOJ|
SYSCTL_PERIPH_GPIOK|SYSCTL_PERIPH_GPIOL|SYSCTL_PERIPH_GPIOM|
SYSCTL_PERIPH_GPION|SYSCTL_PERIPH_GPIOP|SYSCTL_PERIPH_GPIOQ);
//
// Create Hwi to register the HWI ISR with the TIVA
//
hwiHandle = Hwi_create(INTNO, GPIO_SSI_ISR, &hwiParams, &eb); //INTNO => 73
//Return Hwi handle error
if(hwiHandle == NULL)
{
rtrn_stats = ERROR_INVALID_HWIHANDLE;
}
// Enable SSIModule
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI2 );
//
// Multiplex SSI functionality
//
ROM_GPIOPinConfigure(SSI2CLK);
ROM_GPIOPinConfigure(SSI2RX);
ROM_GPIOPinConfigure(SSI2TX);
//
//Configure Pin as SSI
//
ROM_GPIOPinTypeSSI(GPIO_PORTB_BASE, GPIO_PIN_4|GPIO_PIN_6|GPIO_PIN_7);
//
//Configure Pin for chip select
//
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE,CS_ADC);
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTQ_BASE,CS_DAC|CS_FLASH);
ROM_SSIConfigSetExpClk(SSI2_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_3,
SSI_MODE_MASTER, SysCtlClockGet()/8, 8);
//
// Enable the SSI2 module.
//
ROM_SSIEnable(SSI2_BASE);
while (ROM_SSIDataGetNonBlocking(SSI2_BASE, &dummyRead)) {
}
//
// Enable SSI2 Interrupt
//
ROM_IntEnable(INT_SSI2 );
// Enable End of Transmission Interrupt and Default value
SSIRIS |= SSIINTBIT ;
//
// Enable the SSI2 module.
//
........
........
}
So for each data transfer on SPI slave(DAC8564 in my case), my ISR, GPIO_SSI_ISR should be hit in which I am posting an event as evident from the code, but this is not happening. Rather I am getting below error message:
ti.sysbios.knl.Event: line 205: assertion failure: A_badContext: bad calling context. Must be called from a Task.
xdc.runtime.Error.raise: terminating execution
Can anyone guide me if I am missing anything in the code in order to generated HWI or can anybody give me the simple steps to configure an HWI interrupt using SPI EOT interrupt and execute the ISR.
Any sample code for such scenario will help.
Regards,
Mritunjai