Part Number:SK-TDA4VM
TI专家您好,最近在看pdk_jacinto_08_06_01_03这个组件下关于ospi的示例代码main_ospi_flash_test.c,
想参考此代码直接改成通用的单线或双线或四线,或8线spi读写来使用吗?
改写的伪代码如下:
... Board_init(boardCfg); ...
OSPI_init();
OSPI_v0_HwAttrs ospi_cfg;
OSPI_socInit();
OSPI_socGetInitCfg(SPI_OSPI_DOMAIN_MCU,peripheralNum,&ospi_cfg);
ospi_cfg.dac.dacEnable=true;
ospi_cfg.dac.dmaEnable=false;
ospi_cfg.dac.intrEnable=false;
ospi_cfg.dac.phyEnable=false;
ospi_cfg.dac.dtrEnable=false;
ospi_cfg.dac.xferLines=OSPI_XTER_LINES_SINGLE;
ospi_cfg.dac.funcClk=OSPI_MODULE_CLK_133M;
ospi_cfg.devDelays[3]=OSPI_DEV_DELAY_CSDA;
OSPI_socSetInitCfg(SPI_OSPI_DOMAIN_MCU,peripheralNum,&ospi_cfg);
OSPI_Handle * handle;
*Handle=OSPI_open(SPI_OSPI_DOMAIN_MCU);
...
//tx data
OSPI_Transaction ospiTransaction; ospiTransaction.count = n;/* Transfer Length */ ospiTransaction.txBuf = transmitBuffer; /* Buffer to be written */ ospiTransaction.rxBuf = NULL; /* Buffer holding the received data */ transferOK = OSPI_transfer(ospi, &ospiTransaction); /* Perform OSPI transfer */ if (!transferOK) { /* OSPI transaction failed */ }
对于上述代码编译并在板子上运行时,我测试时钟线时却发现多了一个字节的时钟波形,比如发送1个字节,测试却有两个字节的时钟波形,发送3个字节,有4个字节的时钟波形?
另外当我设置为八线时(ospi_cfg.dac.xferLines=OSPI_XTER_LINES_OCTAL;),写一个字节的数据是八根数据线分别传输这个字节数据的一位呢,还是一个字节只在一根数据线上传输呢?
期待您的回复,谢谢!
best wishes
Ling Wang
Cherry Zhou:
您好,您的问题我们需要升级到英文论坛寻求帮助,链接如下:
https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1274091/sk-tda4vm-can-ospi-be-used-as-a-generic-one-wire-or-eight-wire-spi-to-transmit-and-receive-device-data
,
wang ling:
专家您好,我关注您提供的英文链接一直没有消息回复呢?麻烦您帮我看看是怎么回事呢,谢谢!
,
Cherry Zhou:
十分抱歉,我们来催促下工程师看看。
,
wang ling:
您好,请问工程师这边有相关回复了吗?
,
Cherry Zhou:
您好,
十分抱歉,暂时还没有。该条产品线回复周期较慢,如周五前仍未给到您答复,我们来发邮件催促下工程师。
,
Cherry Zhou:
您好,
请参考下贴中的答复:
1) https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1281413/tda4vm-using-r5fmcu-in-tda4-to-control-ospi-legacy-mode-read-and-write-operations
2) https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1279417/tda4vm-the-i-os-of-the-ospi-module-are-connected-to-an-external-spi-device-as-a-legacy-spi-mode