TI中文支持网
TI专业的中文技术问题搜集分享网站

TDA4VM: mcu2_0使用mainspi无法打开SPI

Part Number:TDA4VM

我在vision_apps的vision_apps\platform\j721e\rtos\mcu2_0目录下main.c,里增加了SPI1的操作,但是整个进程会卡在SPI_open这里,无法执行下去,以下是我增加的操作的SPI的代码:

void spi_open(uint32_t instance,uint32_t domain)
{SPI_Handlespi;
	SPI_ParamsspiParams;// uint32_tinstance, 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);}

}

从LOG来看是进入SPI_open后没有出来,能否帮忙看看是不是代码上有什么问题导致的?

SDK版本:ti-processor-sdk-rtos-j721e-evm-08_05_00_11

Shine:

请问用的是TI的EVM板还是自己的板子?

,

wei dong:

EVM板子和我自己的板子都是这样的情况

,

Shine:

已咨询e2e英文论坛工程师,请关注下面帖子的回复。https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1290819/tda4vm-failed-to-add-spi1-to-mcu2_0

赞(0)
未经允许不得转载:TI中文支持网 » TDA4VM: mcu2_0使用mainspi无法打开SPI
分享到: 更多 (0)