I am using EVMAM437x board, software is starterware.
I tried to run the McSPI example, which named flash_app_main.c. It always died on the intialization of interrupt.
I planned to use McSPI2, Channel2. The default structure is:
/** \brief Application default configuration */
static const mcspiAppCfgObj_t MCSPIAPPFLASH_DEFAULT =
{
2U, /* instNum.*/
0x481A2000, /* instAddr.*/
48000000U, /* inClk.*/
24000000U, /* outClk.*/
2U, /* channelNum.*/
0U, /* dataLength.*/
gFlashAppTxBuffer, /* pTx.*/
gFlashAppRxBuffer, /* rTx.*/
{
MCSPI_CH_SINGLE, /* channel.*/
MCSPI_TRANSFER_MODE_TX_RX, /* txRxMode.*/
//MCSPI_DATA_LINE_COMM_MODE_1, /* pinMode. */
MCSPI_DATA_LINE_COMM_MODE_1, /* pinMode. MCSPI_CH(i)CONF - Input Select (bit 18) - Reception on Data Line 0 or Data Line 1
- DPE1 (bit 17) - Transmission enable/disable for data line 1 (SPIDATAGZEN[1])
- DPE0 (bit 16) - Transmission enable/disable for data line 0 (SPIDATAGZEN[0])*/
MCSPI_CLK_MODE_0, /* clkMode.POL PHA*/
8U, /* wordLength.*/
MCSPI_CS_POL_LOW, /* csPolarity.*/
TRUE, /* txFifoCfg.*/
TRUE, /* rxFifoCfg.*/
MCSPI_INTR_TX_EMPTY(2U) | \
MCSPI_INTR_RX_FULL(2U) /* interrupt.*/
},
{
INTC_TRIG_HIGH_LEVEL, /* trigType.*/
158U, /* intrLine.*/
10U, /* intrPriority.*/
FALSE, /* isIntrSecure.*/
NULL, /* pTxBuf.*/
NULL, /* pRxBuf.*/
NULL /* pFnIntrHandler.*/
},
{
TRUE, /* csFlag.*/
MCSPI_MODE_MASTER, /* modeFlag. master of slave*/
//MCSPI_INTERRUPT_MODE, /* comFlag.*/
MCSPI_INTERRUPT_MODE /* comFlag.*/
}
};
The Api is
mcspiAppIntrParams.triggerType = pCfgMcspi->intrCfg.trigType;
mcspiAppIntrParams.priority = pCfgMcspi->intrCfg.intrPriority;
mcspiAppIntrParams.pFnIntrHandler = McspiAppFlashIsr;
mcspiAppIntrParams.pUserParam = pCfgMcspi;
mcspiAppIntrParams.isIntrSecure = pCfgMcspi->intrCfg.isIntrSecure;
retVal = INTCConfigIntr(pCfgMcspi->intrCfg.intrLine, &mcspiAppIntrParams, FALSE);
The Return Value of the API is "Parameter passed is invalid".
I would be appreciated, if anyone could tell me why I cannot initialize the interrupt.
Best Regards,
Yuzhi