Hi,
I'm using main mcspi3 to communicate with external device in mcu2_1 in psdk7.00 refer the main_mcspi_slave_mode.c. When mcspi3 work in poll mode. All things are good. I can transfer and receive data correctly.
But when I trying using the callback mode, I using CSLR_R5FSS0_INTROUTER0_IN_MCSPI3_INTR_SPI_0 as interrupt number. Then in SPI_v1.c the interrupt will register error. Also my callback function will not trigger.
if ((chObj->operMode != (uint32_t)SPI_OPER_MODE_POLLING) && (object->hwi == NULL)) { /* register interrrupt when the 1st channel of the instance is opened */ Osal_RegisterInterrupt_initParams(&interruptRegParams); interruptRegParams.corepacConfig.name=NULL; #ifdef __TI_ARM_V7R4 interruptRegParams.corepacConfig.priority=0x8U; #else interruptRegParams.corepacConfig.priority=0x20U; #endif interruptRegParams.corepacConfig.corepacEventNum = (int32_t)hwAttrs->eventId; interruptRegParams.corepacConfig.intVecNum = (int32_t)hwAttrs->intNum; /* Host Interrupt vector */ interruptRegParams.corepacConfig.isrRoutine = (void (*)(uintptr_t))(&MCSPI_v1_hwiFxn); interruptRegParams.corepacConfig.arg = (uintptr_t)mcHandle; (void)SPI_osalRegisterInterrupt(&interruptRegParams,&(object->hwi)); if(object->hwi == NULL) { MCSPI_close_v1(mcHandle); ret_flag = 1u; retMcHandle = NULL; printf("Enter %s %d\n", __FUNCTION__, __LINE__); } }
It will return because object->hwi is NULL.
So which interrupt number should I use to enable callback mode ?
Regards