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

cross mob
Translation_Bot
Community Manager
Community Manager
Community Manager

關於tc397做master, 一次呼叫IfxQspi_SpiMaster_exchange交換4個位元組的資料.byte之間傳輸的時候,clk怎麼配置成非連續的?也就是每一個byte傳輸完之後, 想要有一個idle clk的狀態, 再開始傳輸下一個byte.

SAL-TC397XP-256F300S BD @Jeremy_Z

clk.png

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/AURIX/tc397-qspi-%E5%85%B3%E4%BA%8Etc397%E5%81%9Amaster-%E4%B8%80%E6%AC%A1%E8%B0%83%E7%94%A8IfxQspi-SpiMaster-exchange%E4%BA%A4%E6%8D%A24%E4%B8%AA%E5%AD%97%E8%8A%82%E7%9A%84%E6%95%B0%E6%8D%AE-byte%E4%B9%8B%E9%97%B4%E4%BC%A0%E8%BE%93%E7%9A%84%E6%97%B6%E5%80%99/td-p/653474

1 解決方案
Translation_Bot
Community Manager
Community Manager
Community Manager

Hi andersons,

你好,你可以先檢查下這個BACON暫存器是不是修改成功了,例如打一個斷點來看看。還有你可以參考下範例程式碼:

SPI_CPU_1_KIT_TC397_TFT

以及這個函數,可以配置BACON的:

IfxQspi_calculateBasicConfigurationValue
 

謝謝

 

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/AURIX/tc397-qspi-%E5%85%B3%E4%BA%8Etc397%E5%81%9Amaster-%E4%B8%80%E6%AC%A1%E8%B0%83%E7%94%A8IfxQspi-SpiMaster-exchange%E4%BA%A4%E6%8D%A24%E4%B8%AA%E5%AD%97%E8%8A%82%E7%9A%84%E6%95%B0%E6%8D%AE-byte%E4%B9%8B%E9%97%B4%E4%BC%A0%E8%BE%93%E7%9A%84%E6%97%B6%E5%80%99/m-p/653832

在原始文章中檢視解決方案

0
4 回應
Translation_Bot
Community Manager
Community Manager
Community Manager

你好,

這邊有幾個delay: idleA, idleB, leading delay 和trailing delay。你想說的是最後一個對吧?

Kunqiao_L_0-1701830091148.png

你可以看看這個暫存器BACON

Kunqiao_L_1-1701830166371.png

謝謝

 

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/AURIX/tc397-qspi-%E5%85%B3%E4%BA%8Etc397%E5%81%9Amaster-%E4%B8%80%E6%AC%A1%E8%B0%83%E7%94%A8IfxQspi-SpiMaster-exchange%E4%BA%A4%E6%8D%A24%E4%B8%AA%E5%AD%97%E8%8A%82%E7%9A%84%E6%95%B0%E6%8D%AE-byte%E4%B9%8B%E9%97%B4%E4%BC%A0%E8%BE%93%E7%9A%84%E6%97%B6%E5%80%99/m-p/653495

0
Translation_Bot
Community Manager
Community Manager
Community Manager

看起來是的,但是我在嘗試配置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

 

 

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/AURIX/tc397-qspi-%E5%85%B3%E4%BA%8Etc397%E5%81%9Amaster-%E4%B8%80%E6%AC%A1%E8%B0%83%E7%94%A8IfxQspi-SpiMaster-exchange%E4%BA%A4%E6%8D%A24%E4%B8%AA%E5%AD%97%E8%8A%82%E7%9A%84%E6%95%B0%E6%8D%AE-byte%E4%B9%8B%E9%97%B4%E4%BC%A0%E8%BE%93%E7%9A%84%E6%97%B6%E5%80%99/m-p/653697

0
Translation_Bot
Community Manager
Community Manager
Community Manager

Hi andersons,

你好,你可以先檢查下這個BACON暫存器是不是修改成功了,例如打一個斷點來看看。還有你可以參考下範例程式碼:

SPI_CPU_1_KIT_TC397_TFT

以及這個函數,可以配置BACON的:

IfxQspi_calculateBasicConfigurationValue
 

謝謝

 

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/AURIX/tc397-qspi-%E5%85%B3%E4%BA%8Etc397%E5%81%9Amaster-%E4%B8%80%E6%AC%A1%E8%B0%83%E7%94%A8IfxQspi-SpiMaster-exchange%E4%BA%A4%E6%8D%A24%E4%B8%AA%E5%AD%97%E8%8A%82%E7%9A%84%E6%95%B0%E6%8D%AE-byte%E4%B9%8B%E9%97%B4%E4%BC%A0%E8%BE%93%E7%9A%84%E6%97%B6%E5%80%99/m-p/653832

0
Translation_Bot
Community Manager
Community Manager
Community Manager

根據這個函數IfxQspi_calculateBasicConfigurationValue可以配置成功,感謝支持!

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/AURIX/tc397-qspi-%E5%85%B3%E4%BA%8Etc397%E5%81%9Amaster-%E4%B8%80%E6%AC%A1%E8%B0%83%E7%94%A8IfxQspi-SpiMaster-exchange%E4%BA%A4%E6%8D%A24%E4%B8%AA%E5%AD%97%E8%8A%82%E7%9A%84%E6%95%B0%E6%8D%AE-byte%E4%B9%8B%E9%97%B4%E4%BC%A0%E8%BE%93%E7%9A%84%E6%97%B6%E5%80%99/m-p/653941

0