FLEXCOMM3_DriverIRQHandler is getting invoked even defining my own interrupt handler

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

FLEXCOMM3_DriverIRQHandler is getting invoked even defining my own interrupt handler

378 次查看
sushmasan
Contributor II

Hello Team,

I am seeing an issue, not sure what is missing.

Please find more details,

#define SPI3_IF          		SPI3
#define SPI3_CLK_SRC  			kCLOCK_Flexcomm3
#define SPI3_CLK_FREQ 			CLOCK_GetFlexCommClkFreq(3U)
#define SPI3_SLAVE_SELECT       0
#define SPI3_IRQHandler  		FLEXCOMM3_IRQHandler
#define SPI3_IRQn				FLEXCOMM3_IRQn

 

Below is my interrupt handler,

uint16_t receiveBuff[256];
void SPI3_IRQHandler(void)
{
	uint16_t tmp_data;

	PRINTF("(%s) - %s() at line %d -> START\r\n",__FILE__,__func__,__LINE__);

	if ((SPI_GetStatusFlags(SPI3_IF) & kSPI_RxNotEmptyFlag))
        {
             tmp_data = SPI_ReadData(SPI3_IF);
	     receiveBuff[rxIndex] = tmp_data;
        }

SDK_ISR_EXIT_BARRIER;
}

 

In the spi initialization,

SPI_MasterGetDefaultConfig(&masterConfig);

	// Set the baudrate
	masterConfig.enableLoopback = false;
	masterConfig.enableMaster = true;
	masterConfig.polarity = kSPI_ClockPolarityActiveHigh;
	masterConfig.phase = kSPI_ClockPhaseFirstEdge;
	masterConfig.direction = kSPI_MsbFirst;
	masterConfig.baudRate_Bps = SPI3_BAUDRATE_500000;
	masterConfig.sselNum = kSPI_Ssel0;
	masterConfig.sselPol = (spi_spol_t)SPI3_SPOL;

	// SPI enable and Mast mode selection is done as part of this
	SPI_MasterInit(SPI3_IF, &masterConfig, SPI3_CLK_FREQ);

        SPI_EnableInterrupts(SPI3_IF, kSPI_TxLvlIrq | kSPI_RxLvlIrq);

        EnableIRQ(SPI3_IRQn);

 

But when I run the code, the control is going to "FLEXCOMM3_DriverIRQHandler", even in debug also I am seeing the same behavior. So I am wondering what is causing that.

I understand that, SDK specific interrupt handler gets invoked, only when there is any interrupt handler defined for it, but in this scenario there is an already interrupt handler defined.

 

Can someone please let me know, what is missing?

0 项奖励
回复
2 回复数

328 次查看
sushmasan
Contributor II

Hello Team,

Can someone please look into this and let me know what I am  missing?

Regards,
San

0 项奖励
回复

315 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hi @sushmasan 

The SDK uses a vector table redirection mechanism where:

-The actual interrupt vector table points to SDK-provided handlers (like FLEXCOMM3_DriverIRQHandler)

- These handlers then call your user-defined handlers if they exist

Please try to modify the vector table.

  1. Locate the interrupt vector table.
  2. Replace FLEXCOMM3_DriverIRQHandler with your SPI3_IRQHandler

Hope it helps. 

If still have any issue, please contact me without any hesitate. Thank you.

 

BR

Alice

 

0 项奖励
回复