<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: S32K344 SPI + DMA Lpspi_Ip_AsyncTransmitFast in S32K</title>
    <link>https://community.nxp.com/t5/S32K/S32K344-SPI-DMA-Lpspi-Ip-AsyncTransmitFast/m-p/1952029#M40832</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/224616"&gt;@not_a_duck&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Could you share the project so that I can test it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 11 Sep 2024 11:16:09 GMT</pubDate>
    <dc:creator>danielmartynek</dc:creator>
    <dc:date>2024-09-11T11:16:09Z</dc:date>
    <item>
      <title>S32K344 SPI + DMA Lpspi_Ip_AsyncTransmitFast</title>
      <link>https://community.nxp.com/t5/S32K/S32K344-SPI-DMA-Lpspi-Ip-AsyncTransmitFast/m-p/1950342#M40731</link>
      <description>&lt;P&gt;This question might be similar to this one:&amp;nbsp;&lt;A href="https://community.nxp.com/t5/S32K/S32K312-LPSPI-DMA-AsyncTransmitFast/m-p/1923811" target="_blank"&gt;https://community.nxp.com/t5/S32K/S32K312-LPSPI-DMA-AsyncTransmitFast/m-p/1923811&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have to send two spi transaction to a device. I am trying to use&amp;nbsp;Lpspi_Ip_AsyncTransmitFast.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;const Lpspi_Ip_FastTransferType ft[] = {
    {
        .ExternalDevice = &amp;amp;Lpspi_Ip_DeviceAttributes_SpiExternalDevice_0_Instance_0,
        .TxBuffer = txbuf_wren,
        .RxBuffer = rxbuf_wren,
        .DefaultData = 0,
        .Length = 1,
        .KeepCs = false,
    },
    {
        .ExternalDevice = &amp;amp;Lpspi_Ip_DeviceAttributes_SpiExternalDevice_0_Instance_0,
        .TxBuffer = txbuf,
        .RxBuffer = rxbuf,
        .DefaultData = 0,
        .Length = 10,
        .KeepCs = false,
    }
};    

void send_spi_txn(void)
{
    Lpspi_Ip_StatusType status = Lpspi_Ip_AsyncTransmitFast( ft, 2, Lpspi_Ip_Callback_lpspi_0_dma );
    if (status != LPSPI_IP_STATUS_SUCCESS)
    {
        failed_spi_dma = true;
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;I have already tested using&amp;nbsp;Lpspi_Ip_AsyncTransmit to send a single transaction and then sending another one from the completion callback, but this is obviously not ideal so would like to be able to use the transferlist instead.&lt;BR /&gt;&lt;BR /&gt;The issue is that no data is being sent. the first time&amp;nbsp;Lpspi_Ip_AsyncTransmitFast is called it reports success, but every subsequent call fails. also can see that there are no spi transfers. on the logic analyzer, but when i just do&amp;nbsp;Lpspi_Ip_AsyncTransmit everything works fine.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2024 20:38:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K344-SPI-DMA-Lpspi-Ip-AsyncTransmitFast/m-p/1950342#M40731</guid>
      <dc:creator>not_a_duck</dc:creator>
      <dc:date>2024-09-09T20:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: S32K344 SPI + DMA Lpspi_Ip_AsyncTransmitFast</title>
      <link>https://community.nxp.com/t5/S32K/S32K344-SPI-DMA-Lpspi-Ip-AsyncTransmitFast/m-p/1950388#M40736</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/52961"&gt;@PetrS&lt;/a&gt;&amp;nbsp;or&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/52613"&gt;@davidtosenovjan&lt;/a&gt;&amp;nbsp;do either of you have any suggestions on what i can check?&lt;BR /&gt;&lt;BR /&gt;one additional thing i have noticed is that the dma interrupt for the tx channel is being called repeatedly. it is supposed to call&amp;nbsp;Lpspi_Ip_LPSPI_0_IrqTxDmaHandler callback but it never does.&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-09-09 at 4.11.50 PM.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/298005i66F5229AF6DDA84F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-09-09 at 4.11.50 PM.png" alt="Screenshot 2024-09-09 at 4.11.50 PM.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-09-09 at 4.11.45 PM.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/298006i26E7EE686F60C822/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-09-09 at 4.11.45 PM.png" alt="Screenshot 2024-09-09 at 4.11.45 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2024 23:14:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K344-SPI-DMA-Lpspi-Ip-AsyncTransmitFast/m-p/1950388#M40736</guid>
      <dc:creator>not_a_duck</dc:creator>
      <dc:date>2024-09-09T23:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: S32K344 SPI + DMA Lpspi_Ip_AsyncTransmitFast</title>
      <link>https://community.nxp.com/t5/S32K/S32K344-SPI-DMA-Lpspi-Ip-AsyncTransmitFast/m-p/1950392#M40737</link>
      <description>&lt;P&gt;correction: `&lt;SPAN&gt;Lpspi_Ip_LPSPI_0_IrqTxDmaHandler` actually does get called but only once. and then never again&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2024 23:23:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K344-SPI-DMA-Lpspi-Ip-AsyncTransmitFast/m-p/1950392#M40737</guid>
      <dc:creator>not_a_duck</dc:creator>
      <dc:date>2024-09-09T23:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: S32K344 SPI + DMA Lpspi_Ip_AsyncTransmitFast</title>
      <link>https://community.nxp.com/t5/S32K/S32K344-SPI-DMA-Lpspi-Ip-AsyncTransmitFast/m-p/1952029#M40832</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/224616"&gt;@not_a_duck&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Could you share the project so that I can test it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2024 11:16:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K344-SPI-DMA-Lpspi-Ip-AsyncTransmitFast/m-p/1952029#M40832</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2024-09-11T11:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: S32K344 SPI + DMA Lpspi_Ip_AsyncTransmitFast</title>
      <link>https://community.nxp.com/t5/S32K/S32K344-SPI-DMA-Lpspi-Ip-AsyncTransmitFast/m-p/1952552#M40844</link>
      <description>&lt;P&gt;Unfortunately I can't post the project because I am only using S32DS to configure the RTD and to generate driver config files.&lt;BR /&gt;&lt;BR /&gt;But I was able to work through the issues and unsurprisingly it was a data cache issue with the DMA.&lt;/P&gt;&lt;DIV class=""&gt;as for the setup issues:&lt;/DIV&gt;&lt;UL&gt;&lt;LI&gt;didn't properly link the scatter gather channels. (each channel needs to link to the next one and last one needs to be marked as final)&lt;/LI&gt;&lt;LI&gt;didn't have the tx/rx dma channels priorities correctly (rx higher than tx)&lt;/LI&gt;&lt;LI&gt;didn't have the tx/rx dma channel complete interrupts prioritized correctly. (tx higher than rx)&lt;/LI&gt;&lt;/UL&gt;&lt;DIV class=""&gt;and the data cache issue boiled down to the MemMap.h files.&lt;BR /&gt;nxp uses these defines:&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;#define MCL_START_SEC_VAR_CLEARED_UNSPECIFIED_NO_CACHEABLE&lt;BR /&gt;#include "Mcl_MemMap.h"&lt;BR /&gt;/* Pointer to the DMA Initialization Configuration. Based on this configuration pointer, the DMA Driver obtains all information for the Logic Channels and corresponding Channel Configurations. The Pointer is loaded when Dma_Ip_Init() is called. */&lt;BR /&gt;static const Dma_Ip_InitType * Dma_Ip_pxInit;&lt;BR /&gt;#define MCL_STOP_SEC_VAR_CLEARED_UNSPECIFIED_NO_CACHEABLE&lt;BR /&gt;#include "Mcl_MemMap.h"&lt;/PRE&gt;&lt;DIV class=""&gt;and in the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;lt;module_name&amp;gt;_MemMap.h&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;they define what the compiler should do. in this case&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;#pragma GCC section bss ".mcal_bss_no_cacheable"&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;#ifdef MCL_START_SEC_VAR_CLEARED_UNSPECIFIED_NO_CACHEABLE&lt;BR /&gt;/** &lt;BR /&gt;* @file Mcl_MemMap.h &lt;BR /&gt;*/ &lt;BR /&gt;#undef MCL_START_SEC_VAR_CLEARED_UNSPECIFIED_NO_CACHEABLE &lt;BR /&gt;#define ENTERED_MCL_START_SEC_VAR_CLEARED_UNSPECIFIED_NO_CACHEABLE &lt;BR /&gt;#ifndef MEMMAP_MATCH_ERROR &lt;BR /&gt;#define MEMMAP_MATCH_ERROR &lt;BR /&gt;#else &lt;BR /&gt;#ifndef MCL_STOP_SEC_VAR_CLEARED_UNSPECIFIED_NO_CACHEABLE &lt;BR /&gt;#error "MemMap.h, no valid matching start-stop section defined." &lt;BR /&gt;#endif &lt;BR /&gt;#endif &lt;BR /&gt;/** &lt;BR /&gt;* @file Mcl_MemMap.h &lt;BR /&gt;*/ &lt;BR /&gt;#undef MEMMAP_ERROR &lt;BR /&gt;#pragma GCC section bss ".mcal_bss_no_cacheable" &lt;BR /&gt;#endif&lt;/PRE&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;BR /&gt;for gcc unless you use the gcc version that comes with the s32ds ide or download their specific version of gcc these types of pragmas aren't supported.&lt;BR /&gt;so for now i just went through all the rtd files that used dma and manually added the right section attributes to make them non-cacheable either&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;.mcal_bss_no_cacheable&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;or&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;.mcal_data_no_cacheableso for the snippet above i had to add:&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;PRE&gt;__attribute__((section(".mcal_bss_no_cacheable")))&lt;BR /&gt;static const Dma_Ip_InitType * Dma_Ip_pxInit;&lt;/PRE&gt;&lt;DIV class=""&gt;&lt;BR /&gt;i replaced all the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;lt;module_name&amp;gt;_MemMap.h&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;with empty dummy files to make the compiler happy which means i have to manually add all the __attribute__((section())) compiler directives.&lt;/DIV&gt;</description>
      <pubDate>Wed, 11 Sep 2024 20:13:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K344-SPI-DMA-Lpspi-Ip-AsyncTransmitFast/m-p/1952552#M40844</guid>
      <dc:creator>not_a_duck</dc:creator>
      <dc:date>2024-09-11T20:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: S32K344 SPI + DMA Lpspi_Ip_AsyncTransmitFast</title>
      <link>https://community.nxp.com/t5/S32K/S32K344-SPI-DMA-Lpspi-Ip-AsyncTransmitFast/m-p/2078343#M47652</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;is there any further update on this topic? is there any example project available.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Apr 2025 12:20:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K344-SPI-DMA-Lpspi-Ip-AsyncTransmitFast/m-p/2078343#M47652</guid>
      <dc:creator>Ashin</dc:creator>
      <dc:date>2025-04-10T12:20:33Z</dc:date>
    </item>
  </channel>
</rss>

