<?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>Kinetis Software Development KitのトピックRe: Trying to work through SAI with DMA on Kinetis K22.</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Trying-to-work-through-SAI-with-DMA-on-Kinetis-K22/m-p/331963#M124</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Matching : &lt;/P&gt;&lt;P&gt;i2s_config.channel = 1 &lt;/P&gt;&lt;P&gt;To&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.7272720336914px; line-height: 1.5em;"&gt;&amp;nbsp; fifobase = SAI_HAL_RxGetFifoAddr((uint32_t)I2S0_BASE, 1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.7272720336914px; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.7272720336914px; line-height: 1.5em;"&gt;alleviates crashing into default handler, however I'm still only seeing 0's on my audio buffer...&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Nov 2014 20:56:10 GMT</pubDate>
    <dc:creator>bosleymusic_com</dc:creator>
    <dc:date>2014-11-18T20:56:10Z</dc:date>
    <item>
      <title>Trying to work through SAI with DMA on Kinetis K22.</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Trying-to-work-through-SAI-with-DMA-on-Kinetis-K22/m-p/331960#M121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Working through setting up SAI with DMA for K22. SAI was very easy, clear documentation. DMA is a little more convoluted with a variety of data structures used between TWR Examples (which incorporate the soundcard API), AN4520, AN4800, and eDMA APIs. I need to clarify some things, so let's start with this :&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1) EDMA_DRV_RequestChannel &lt;/STRONG&gt;works in terms of assigning a channel using either the kEDMAAnyChannel, or by directly selecting the channel I want. Verified with the return argument however :&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: Roboto, sans-serif; font-size: 14px;"&gt;&lt;EM&gt;"chn : The pointer to the eDMA channel state...&lt;STRONG&gt;The use must pass the memory for this run-time state structure and the eDMA peripheral driver fills out the members.&lt;/STRONG&gt; This run-time...&lt;/EM&gt;&lt;/SPAN&gt;&lt;A class="el" style="color: #4665a2; font-weight: bold; font-family: Roboto, sans-serif; font-size: 14px;" title="Releases an eDMA channel. "&gt;&lt;EM&gt;"&lt;/EM&gt;&lt;/A&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only member it seems to fill out is channel, so my assumption is that the remaining members will be filled by the later functions? (According to the API example, this should be fine)&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2)&lt;/STRONG&gt;But, when I go to fire off the next function EDMA_DRV_ConfigLoopTransfer, I'm dumping in to default handler.&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; I have the fsl_edma_irq.c included, and the functions are showing up, so I know the default IRQs set in SETUP are available, or at least appear to be. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The subfunction it's tanking at is: &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Set the software TCD memory to default value. */&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; memset(stcdAddr, 0, number * sizeof(edma_software_tcd_t));&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any clues? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2014 20:38:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Trying-to-work-through-SAI-with-DMA-on-Kinetis-K22/m-p/331960#M121</guid>
      <dc:creator>bosleymusic_com</dc:creator>
      <dc:date>2014-11-11T20:38:01Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to work through SAI with DMA on Kinetis K22.</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Trying-to-work-through-SAI-with-DMA-on-Kinetis-K22/m-p/331961#M122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Reading a possible reason for the failure being :&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;* @param stcd Memory pointing to software TCDs. The user must prepare this memory block. The required&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;* memory size is equal to a "period" * size of(edma_software_tcd_t). &lt;EM&gt;At the same time, the "stcd"&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;* must align with 32 bytes. If not, an error occurs in the eDMA driver.&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I changed my initialization of the tcd variable to:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;edma_software_tcd_t *i2s0_dma_tcd = (edma_software_tcd_t *) OSA_MemAlloc(&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;STRONG&gt;sizeof(edma_software_tcd_t));&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;This seems to work, but I still am not totally clear on how the ConfigLoopTransfer relates back to the settings of eDMA controller itself. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Can someone verify the following arguments for me from EDMA_DRV_ConfigLoopTransfer:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; * @param size Size to be transferred on every DMA write/read. Source/Dest share the same write/read&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; * size. ----&amp;gt; SIZE IN TOTAL BYTES? SIZE IN UNITS OF THE ALREADY ESTABLISHED DATA WIDTH? ALIGNED DATA FROM SAI FIFO? CONFUSED.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; * @param bytesOnEachRequest Size write/read for every trigger of the DMA request.--&amp;gt; In bytes....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt; * @param totalLength Total length of Memory. ---&amp;gt; IN BYTES OR ?&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; * @param number A number of the descriptor that is configured for this transfer configuration. ---&amp;gt; NEWB QUESTION, BUT WHAT IS THE DESCRIPTOR IN THIS CASE? IS IT THE SAME AS THE CHANNEL NUMBER?&amp;nbsp; IS IT THE MUXID? I'm just not clear on this value.&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2014 16:51:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Trying-to-work-through-SAI-with-DMA-on-Kinetis-K22/m-p/331961#M122</guid>
      <dc:creator>bosleymusic_com</dc:creator>
      <dc:date>2014-11-12T16:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to work through SAI with DMA on Kinetis K22.</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Trying-to-work-through-SAI-with-DMA-on-Kinetis-K22/m-p/331962#M123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Crashing Example #1 :&lt;/P&gt;&lt;P&gt;/***** I2S FORMAT STRUCTURE ******/&lt;/P&gt;&lt;P&gt;&amp;nbsp; i2s_data_format.bits = 16;&lt;/P&gt;&lt;P&gt;&amp;nbsp; i2s_data_format.sample_rate = 16000;&lt;/P&gt;&lt;P&gt;&amp;nbsp; i2s_data_format.mclk = 256 * i2s_data_format.sample_rate;&lt;/P&gt;&lt;P&gt;&amp;nbsp; i2s_data_format.mono_streo = kSaiMono;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /***** RECEIVER SETTINGS *****/&lt;/P&gt;&lt;P&gt;&amp;nbsp; i2s_config.bclk_source = kSaiBclkSourceMclkDiv;&lt;/P&gt;&lt;P&gt;&amp;nbsp; i2s_config.channel = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; i2s_config.mclk_divide_enable = true;&lt;/P&gt;&lt;P&gt;&amp;nbsp; i2s_config.mclk_source = kSaiMclkSourceSysclk;&lt;/P&gt;&lt;P&gt;&amp;nbsp; i2s_config.protocol = kSaiBusI2SLeft;&lt;/P&gt;&lt;P&gt;&amp;nbsp; i2s_config.slave_master = kSaiMaster;&lt;/P&gt;&lt;P&gt;&amp;nbsp; i2s_config.sync_mode = kSaiModeAsync;&lt;/P&gt;&lt;P&gt;&amp;nbsp; i2s_config.watermark = 8;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /***** LOOP SETUP *****/&lt;/P&gt;&lt;P&gt;&amp;nbsp; i2s_dma_loop_setup.dmaChanNum = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; i2s_dma_loop_setup.dmaCh = &amp;amp;dmaCh0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; i2s_dma_loop_setup.type = kEDMAPeripheralToMemory;&lt;/P&gt;&lt;P&gt;&amp;nbsp; i2s_dma_loop_setup.chSource = kDmaRequestMux0I2S0Rx;&lt;/P&gt;&lt;P&gt;&amp;nbsp; fifobase = SAI_HAL_RxGetFifoAddr((uint32_t)I2S0_BASE, 1);&lt;/P&gt;&lt;P&gt;&amp;nbsp; i2s_dma_loop_setup.srcAddr = (uint32_t)fifobase;&lt;/P&gt;&lt;P&gt;&amp;nbsp; i2s_dma_loop_setup.destAddr = (uint32_t)&amp;amp;audio_buffer[0];&lt;/P&gt;&lt;P&gt;&amp;nbsp; i2s_dma_loop_setup.length = sizeof(audio_buffer);&lt;/P&gt;&lt;P&gt;&amp;nbsp; i2s_dma_loop_setup.size = 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; i2s_dma_loop_setup.watermark = 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; i2s_dma_loop_setup.period = 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; i2s_dma_loop_setup.dmaCallBack = spectrum_edma_callback;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.63636302948px;"&gt;..... &lt;/SPAN&gt;Send some values to codec over I2C .....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAI_DRV_RxInit(0, &amp;amp;i2s_config, &amp;amp;i2s_state);&lt;/P&gt;&lt;P&gt;SAI_DRV_RxConfigDataFormat(0, &amp;amp;i2s_data_format);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.63636302948px;"&gt;..... &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.63636302948px;"&gt;Send some more values to codec over I2C .....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.63636302948px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.63636302948px;"&gt;setup_edma_loop(&amp;amp;i2s_dma_loop_setup); // FUNCTION BORROWED FROM EDSPI EXAMPLE...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SAI_HAL_RxSetDmaCmd(I2S0_BASE, kSaiDmaReqFIFORequest ,true);&lt;/P&gt;&lt;P&gt;EDMA_DRV_StartChannel(&amp;amp;dmaCh0);&lt;/P&gt;&lt;P&gt;SAI_DRV_RxStartModule(0);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Nov 2014 19:46:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Trying-to-work-through-SAI-with-DMA-on-Kinetis-K22/m-p/331962#M123</guid>
      <dc:creator>bosleymusic_com</dc:creator>
      <dc:date>2014-11-17T19:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to work through SAI with DMA on Kinetis K22.</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Trying-to-work-through-SAI-with-DMA-on-Kinetis-K22/m-p/331963#M124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Matching : &lt;/P&gt;&lt;P&gt;i2s_config.channel = 1 &lt;/P&gt;&lt;P&gt;To&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.7272720336914px; line-height: 1.5em;"&gt;&amp;nbsp; fifobase = SAI_HAL_RxGetFifoAddr((uint32_t)I2S0_BASE, 1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.7272720336914px; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.7272720336914px; line-height: 1.5em;"&gt;alleviates crashing into default handler, however I'm still only seeing 0's on my audio buffer...&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2014 20:56:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Trying-to-work-through-SAI-with-DMA-on-Kinetis-K22/m-p/331963#M124</guid>
      <dc:creator>bosleymusic_com</dc:creator>
      <dc:date>2014-11-18T20:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to work through SAI with DMA on Kinetis K22.</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Trying-to-work-through-SAI-with-DMA-on-Kinetis-K22/m-p/331964#M125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Donald&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why you need a loop mode? I see you need to get RX data from codec. the edma_setup_loop is in the dspi_edma_demo to get a SPI0/1 loop for testing edma.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Nov 2014 06:52:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Trying-to-work-through-SAI-with-DMA-on-Kinetis-K22/m-p/331964#M125</guid>
      <dc:creator>xinyu_chen</dc:creator>
      <dc:date>2014-11-19T06:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to work through SAI with DMA on Kinetis K22.</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Trying-to-work-through-SAI-with-DMA-on-Kinetis-K22/m-p/331965#M126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd like to circular buffer, and wasn't sure if I should use loop mode, or modulo. The edma_setup_loop gave me a clear understanding of the EDMA_ConfigLoopTransfer function because the data structure for edam_setup_loop was clearer to me in terms of what value needed to be what for my needs.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Nov 2014 07:12:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Trying-to-work-through-SAI-with-DMA-on-Kinetis-K22/m-p/331965#M126</guid>
      <dc:creator>bosleymusic_com</dc:creator>
      <dc:date>2014-11-19T07:12:59Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to work through SAI with DMA on Kinetis K22.</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Trying-to-work-through-SAI-with-DMA-on-Kinetis-K22/m-p/331966#M127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why use loop mode - &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;Configure the TCD chain in a loop way. Audio playback/Record is the common case." &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Straight out of your API documentation.&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Nov 2014 16:12:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Trying-to-work-through-SAI-with-DMA-on-Kinetis-K22/m-p/331966#M127</guid>
      <dc:creator>bosleymusic_com</dc:creator>
      <dc:date>2014-11-19T16:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to work through SAI with DMA on Kinetis K22.</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Trying-to-work-through-SAI-with-DMA-on-Kinetis-K22/m-p/331967#M128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the answer to all of this, and yes loop mode is certainly what I need to use. &lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/message/455893"&gt;Here's an example for using SAI w/EDMA without the SND API (K22).&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Nov 2014 02:57:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Trying-to-work-through-SAI-with-DMA-on-Kinetis-K22/m-p/331967#M128</guid>
      <dc:creator>bosleymusic_com</dc:creator>
      <dc:date>2014-11-21T02:57:55Z</dc:date>
    </item>
  </channel>
</rss>

