This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM5728: MCSPI init configuration

Part Number: AM5728
Other Parts Discussed in Thread: SYSBIOS

I'm trying to use McSPI from DSP side, so I did remove the mcspi1 node in Linux DTS.

My DSP project is built under Linux. and I just follow the example to do the initialization. I track the mcspi_handle, it's NULL as I found. 

And also the SPI_v1_Object->hwi is NULL, I'm not sure about the TI's PDK, how to define the HWI for McSPI for EDMA function.

I'd like to know when SPI_v1_Object->hwi, this property assigned and it is by TI's cfg or by user manual code?

Below is my code, would you please check it?

How to assign HWI? Any example for McSPI explict show this application?

Thanks a lot!

MCSPI_Board_crossbarInit();
padConfig_prcmEnable();
instance = MCSPI_INSTANCE;
SPI_initConfig(instance);
SPI_init();
/* Default SPI configuration parameters */
MCSPI_Params_init(&mcSpiParams);
mcSpiParams.frameFormat = SPI_POL1_PHA0;
mcSpiParams.transferTimeout = SemaphoreP_WAIT_FOREVER;
/* Open the default channel first */
gMcSpiHandle = MCSPI_open(instance, MCSPI_CHANNEL_0, &mcSpiParams);
if (gMcSpiHandle == NULL)
{
Log_print0(Diags_INFO, "Error initializing SPI");
}
else
{
Log_print1(Diags_INFO, "SPI instance %d initialized\n", instance);
}

typedef struct SPI_v1_Object_s {
void *mutex; /* trasnfer semaphore */
void *transferComplete; /* transfer complete semaphore */
void *hwi; /* Hwi object */

....

}

dsp.cfg

/* Load the spi package */
var Spi = xdc.loadPackage('ti.drv.spi');
Spi.Settings.socType = socType;
Spi.Settings.useDma = "true";

var drv = xdc.loadPackage("ti.sdo.edma3.drv");
var rm = xdc.loadPackage("ti.sdo.edma3.rm");
var rm = xdc.loadPackage("ti.sdo.edma3.drv.sample");
// com.ti.sdo.edma3
var ECM = xdc.useModule ('ti.sysbios.family.c64p.EventCombiner');
ECM.eventGroupHwiNum[0] = 7;
ECM.eventGroupHwiNum[1] = 8;
ECM.eventGroupHwiNum[2] = 9;
ECM.eventGroupHwiNum[3] = 10;