FLEXCOMM3_DriverIRQHandler is getting invoked even defining my own interrupt handler

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

FLEXCOMM3_DriverIRQHandler is getting invoked even defining my own interrupt handler

376件の閲覧回数
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 返答(返信)

326件の閲覧回数
sushmasan
Contributor II

Hello Team,

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

Regards,
San

0 件の賞賛
返信

313件の閲覧回数
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 件の賞賛
返信