<?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>MQX Software SolutionsのトピックRe: MQX: DMA Scatter/Gather</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-DMA-Scatter-Gather/m-p/303520#M9752</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Acremonini, did you ever figure out what was going on with the scatter/gather mode? &amp;nbsp;I believe I am having the same issues while using DMA and an SPI interface. &amp;nbsp;Any information you can provide would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; -CoryF&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 10 Jun 2017 23:06:51 GMT</pubDate>
    <dc:creator>coryf</dc:creator>
    <dc:date>2017-06-10T23:06:51Z</dc:date>
    <item>
      <title>MQX: DMA Scatter/Gather</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-DMA-Scatter-Gather/m-p/303518#M9750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Hello,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;we're working on a project on MQX 4.1 that uses DMA to acquire data from an ADC, periodically (every ~5µs) triggered by the PDB. We are using a k60 tower module.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;We setup the DMA using the framework's functions as shown:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-family: 'courier new', courier;"&gt;dma_channel_claim(&amp;amp;ADC_DMA_RX_channel, 0);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //associates DMA channel pointer with channel 0 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #0000ff;"&gt;dma_channel_setup(ADC_DMA_RX_channel, 2, DMA_CHANNEL_FLAG_LOOP_MODE); //the channel has two TCDs running in loop mode&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #0000ff;"&gt;dma_callback_reg(ADC_DMA_RX_channel,(DMA_EOT_CALLBACK)(my_CallBack),NULL); //association of the callback&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #0000ff;"&gt;dma_request_source(ADC_DMA_RX_channel, 40); //Association with ADC0 requests&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #0000ff;"&gt;dma_tcd_reg2mem(&amp;amp;adc_dma_tcd, &amp;amp;ADC0_RA, 2, testDMA,480); //creation of the TCD that moves data from ADCO_RA to an array &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #0000ff;"&gt;dma_transfer_submit(ADC_DMA_RX_channel, &amp;amp;adc_dma_tcd, my_tcd_seq_pointer); //the new TCD is the first one in the channel &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #0000ff;"&gt;dma_tcd_reg2mem(&amp;amp;adc_dma_tcd2, &amp;amp;ADC0_RA, 2, testDMA2,480);&lt;SPAN style="font-family: 'courier new', courier;"&gt;//creation of the TCD that moves data from ADCO_RA to a different array&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #0000ff;"&gt;dma_transfer_submit(ADC_DMA_RX_channel, &amp;amp;adc_dma_tcd2, my_tcd_seq_pointer); &lt;SPAN style="font-family: 'courier new', courier;"&gt;//the new TCD is the second one in the channel&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-family: 'courier new', courier;"&gt;dma_request_enable(ADC_DMA_RX_channel); //start of DMA requests&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our aim is to swing the transfer of data between the first array and the second one, so we can use the data in one array while we are filling the second one with DMA.&lt;/P&gt;&lt;P&gt;While the transfer of data seems to work properly, we're having some issues with the ISR: sometimes the callback receives tcds_done=2 and a tcd_seq increased by two in comparison with the previous call of the function, but we expect to have a callback for each completion of a TCD. Moving a GPIO up and down during the callback and checking the timing with the oscilloscope we verified that there's a callback at the end of every cycle as expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We tried to debug the code and we noticed that at the beginning of the ISR the code latches the content of the TCD registers and the DONE flag in CSR is '0' when an error occurs (the code uses that flag to calculate tcd_seq and tcds_done), while when the cycle runs smoothly DONE is '1'. &lt;/P&gt;&lt;P&gt;Moreover, we noticed that normally the DONE flag is '1', to indicate the last transfer is completed, but the DLASTSGA is already the new TCD's one. How can this be possible? We expected that the DONE flag and the DLASTSGA register belong to the same TCD. &lt;/P&gt;&lt;P&gt;The most strange thing we noticed is that the problem seems correlated to the ADC's frequency: if we slow down the triggering of PDB (we tried with 17µs) the problem disappears.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do someone have an idea to help us?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 May 2014 14:55:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-DMA-Scatter-Gather/m-p/303518#M9750</guid>
      <dc:creator>acremonini</dc:creator>
      <dc:date>2014-05-22T14:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: MQX: DMA Scatter/Gather</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-DMA-Scatter-Gather/m-p/303519#M9751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A service request was created for you regarding this question. You will be contacted by technical support team.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Carlos&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jun 2014 22:10:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-DMA-Scatter-Gather/m-p/303519#M9751</guid>
      <dc:creator>Carlos_Musich</dc:creator>
      <dc:date>2014-06-10T22:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: MQX: DMA Scatter/Gather</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-DMA-Scatter-Gather/m-p/303520#M9752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Acremonini, did you ever figure out what was going on with the scatter/gather mode? &amp;nbsp;I believe I am having the same issues while using DMA and an SPI interface. &amp;nbsp;Any information you can provide would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; -CoryF&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Jun 2017 23:06:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-DMA-Scatter-Gather/m-p/303520#M9752</guid>
      <dc:creator>coryf</dc:creator>
      <dc:date>2017-06-10T23:06:51Z</dc:date>
    </item>
  </channel>
</rss>

