公告

大中华汽车电子生态圈社区并入开发者社区- 更多资讯点击此

Tip / 登入 to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
andersons
Level 3
Level 3
First like received 10 questions asked 10 sign-ins

关于tc397做master, 一次调用IfxQspi_SpiMaster_exchange交换4个字节的数据. byte之间传输的时候,clk怎么配置成非连续的?也就是每一个byte传输完之后, 想要有一个idle clk的状态, 再开始传输下一个byte.

SAL-TC397XP-256F300S BD   @Jeremy_Z 

clk.png

0 点赞
1 解答
Kunqiao_L
Moderator
Moderator
Moderator
First comment on blog First like given 25 likes received

Hi andersons,

你好,你可以先检查下这个 BACON寄存器是不是修改成功了,比如打一个断点看看。还有你可以参考下示例代码:

SPI_CPU_1_KIT_TC397_TFT 

以及这个函数,可以配置BACON的:

IfxQspi_calculateBasicConfigurationValue
 

谢谢

 

在原帖中查看解决方案

4 回复数
Kunqiao_L
Moderator
Moderator
Moderator
First comment on blog First like given 25 likes received

你好,

这边有几个delay: idleA, idleB, leading delay 和 trailing delay。 你想说的是最后一个对吧?

Kunqiao_L_0-1701830091148.png

你可以看看这个寄存器BACON

Kunqiao_L_1-1701830166371.png

谢谢

 

0 点赞
andersons
Level 3
Level 3
First like received 10 questions asked 10 sign-ins

看起来是的,但是我在尝试配置trailing delay,发现示波器没有生效,还是我没有理解真正的配置过程? 可以给我示例的配置code吗?下面是我目前的尝试:

diff --git a/Libraries/iLLD/TC39B/Tricore/Qspi/SpiMaster/IfxQspi_SpiMaster.c b/Libraries/iLLD/TC39B/Tricore/Qspi/SpiMaster/IfxQspi_SpiMaster.c
index 80ab2d7..98726d5 100644
--- a/Libraries/iLLD/TC39B/Tricore/Qspi/SpiMaster/IfxQspi_SpiMaster.c
+++ b/Libraries/iLLD/TC39B/Tricore/Qspi/SpiMaster/IfxQspi_SpiMaster.c
@@ -331,7 +331,8 @@ void IfxQspi_SpiMaster_initChannelConfig(IfxQspi_SpiMaster_ChannelConfig *chConf
     chConfig->sls.input.pin     = NULL_PTR;
     chConfig->sls.input.mode    = IfxPort_InputMode_noPullDevice;
     chConfig->channelBasedCs    = IfxQspi_SpiMaster_ChannelBasedCs_disabled;
-    chConfig->mode              = IfxQspi_SpiMaster_Mode_shortContinuous;
+//    chConfig->mode              = IfxQspi_SpiMaster_Mode_shortContinuous;
+    chConfig->mode              = IfxQspi_SpiMaster_Mode_short;
     chConfig->dummyTxValue      = (uint32)~0;
     chConfig->dummyRxValue      = (uint32)0;
 }
@@ -1095,12 +1096,19 @@ IFX_STATIC void IfxQspi_SpiMaster_write(IfxQspi_SpiMaster_Channel *chHandle)
     {
         if (job->remaining > 0)
         {
+
             IfxQspi_SpiMaster *handle  = chHandle->base.driver->driver;
             Ifx_QSPI          *qspiSFR = handle->qspi;
             IfxQspi_ChannelId  cs      = (IfxQspi_ChannelId)(chHandle->bacon.B.CS);

             Ifx_SizeT          count   = (Ifx_SizeT)(IFXQSPI_HWFIFO_DEPTH - IfxQspi_getTransmitFifoLevel(qspiSFR));

+
+//anderson add
+            IfxQspi_DelayParameters config;
+            config.trailingDelay=3;
+            IfxQspi_setBaconDelayParameters(qspiSFR,&config);
+//
             if (chHandle->firstWrite == TRUE)
             {
                 // -1, since BACON allocates one FIFO entry

 

 

0 点赞
Kunqiao_L
Moderator
Moderator
Moderator
First comment on blog First like given 25 likes received

Hi andersons,

你好,你可以先检查下这个 BACON寄存器是不是修改成功了,比如打一个断点看看。还有你可以参考下示例代码:

SPI_CPU_1_KIT_TC397_TFT 

以及这个函数,可以配置BACON的:

IfxQspi_calculateBasicConfigurationValue
 

谢谢

 

andersons
Level 3
Level 3
First like received 10 questions asked 10 sign-ins

根据这个函数IfxQspi_calculateBasicConfigurationValue可以配置成功, 感谢支持!

0 点赞