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.

TDA4VM: Failed to add SPI1 to mcu2_0

Genius 13655 points
Part Number: TDA4VM

Hello Champs,

HW: TI EVM board
SW: ti-processor-sdk-rtos-j721e-evm-08_05_00_11

Customer added SPI1 code to in vision_apps\platform\j721e\rtos\mcu2_0\main.c, the code will stuck in SPI_open. 

How to resolve the problem?

void spi_open(uint32_t instance,uint32_t domain)
{
SPI_Handle spi;
SPI_Params spiParams;
// uint32_t instance, domain;
//domain = 1;
//instance = 1;
SPI_HWAttrs spi_cfg;

appLogPrintf("spi_open instance=%d,domain=%d enter........\n",instance,domain);

SPI_init();
SPI_socGetInitCfg(domain, instance, &spi_cfg);
appLogPrintf("spi_open instance=%d,domain=%d spi_cfg.intNum=%d........\n",instance,domain,spi_cfg.intNum);

spi_cfg.enableIntr = true;
spi_cfg.edmaHandle = NULL;
spi_cfg.dmaMode = FALSE;
spi_cfg.chnCfg[0].dataLineCommMode = MCSPI_DATA_LINE_COMM_MODE_4;

SPI_socSetInitCfg(domain, instance, &spi_cfg);

SPI_Params_init(&spiParams);
spiParams.transferMode = SPI_MODE_BLOCKING;
spiParams.transferCallbackFxn = NULL;
spiParams.frameFormat=SPI_POL0_PHA1;
spiParams.transferTimeout = 0;
spiParams.mode = SPI_MASTER;

appLogPrintf("SPI_Params_init after........\n");
//memcpy(&spiParams,&SPI_defaultParams,sizeof(SPI_Params));
spi = SPI_open(domain, instance, &spiParams);

if (spi == NULL)
{
appLogPrintf("Error initializing SPI\n");
// goto Err;
}
else
{
appLogPrintf("SPI_%d initializing......\n",instance);
}

}



Thanks
Regards
Shine