<?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>LPC Microcontrollers中的主题 Re: LPC4370 - DMA P2M Too Much Data Transferred</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-DMA-P2M-Too-Much-Data-Transferred/m-p/1638265#M52290</link>
    <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;Thank you for checking my code. Yes, I can confirm that my code enters, executes, and then exits the DMA_IRQHandler properly.&lt;/P&gt;</description>
    <pubDate>Fri, 21 Apr 2023 22:13:17 GMT</pubDate>
    <dc:creator>rulamp</dc:creator>
    <dc:date>2023-04-21T22:13:17Z</dc:date>
    <item>
      <title>LPC4370 - DMA P2M Too Much Data Transferred</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-DMA-P2M-Too-Much-Data-Transferred/m-p/1636481#M52255</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have DMA set up to move data from the HSADC FIFO to memory. This seems to work correctly, however there is some unexpected behavior.&lt;/P&gt;&lt;P&gt;The number of samples transferred is far larger than the 16 words expected. From my understanding, the DMA transfer is initiated when the HSADC FIFO_FULL flag is set. I have set the FIFIO fill level to 15. So after 15 samples, the DMA should trigger and move 16 samples out of the FIFO and into the destination address.&lt;/P&gt;&lt;P&gt;In the DMA handler, I reset the channel to get it ready for another transfer. From my understanding, the next time the DMA transfer occurs, the destination address should be the same (eg: dest[0]), however, it seems as though the destination address is the next address after the last transfer (eg: dest[16]).&lt;BR /&gt;&lt;BR /&gt;This results in the DMA filling up memory incredibly rapidly.&lt;BR /&gt;&lt;BR /&gt;What is going on here?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;void DMA_IRQHandler(void)
{
	Chip_GPDMA_Interrupt(LPC_GPDMA, dmaCh); //clears it

	LPC_GPDMA-&amp;gt;CH[dmaCh].SRCADDR = (uint32_t) &amp;amp;LPC_ADCHS-&amp;gt;FIFO_OUTPUT[0];
	LPC_GPDMA-&amp;gt;CH[dmaCh].DESTADDR = ((uint32_t) &amp;amp;dest[0]);
	LPC_GPDMA-&amp;gt;CH[dmaCh].CONFIG |= 1;
}

void adchs_dma_setup(void)
{
	Chip_GPDMA_Init(LPC_GPDMA);

	dmaCh = Chip_GPDMA_GetFreeChannel(LPC_GPDMA, GPDMA_CONN_ADCHS_READ);

	Chip_GPDMA_Transfer(LPC_GPDMA, dmaCh,
					GPDMA_CONN_ADCHS_READ, (uint32_t) &amp;amp;dest[0],
					GPDMA_TRANSFERTYPE_P2M_CONTROLLER_PERIPHERAL,
					NULL);

	/* Enable GPDMA interrupt */
	NVIC_SetPriority(DMA_IRQn, 0);
	NVIC_ClearPendingIRQ(DMA_IRQn);
	NVIC_EnableIRQ(DMA_IRQn);
}

void adchs_setup(void)
{
	Chip_HSADC_Init(LPC_ADCHS);
	Chip_HSADC_SetupFIFO(LPC_ADCHS, 15, false);
	Chip_HSADC_ConfigureTrigger(LPC_ADCHS, HSADC_CONFIG_TRIGGER_SW,
			HSADC_CONFIG_TRIGGER_RISEEXT, HSADC_CONFIG_TRIGGER_NOEXTSYNC,
			HSADC_CHANNEL_ID_EN_NONE, 0x90);

	Chip_HSADC_SetACDCBias(LPC_ADCHS, 0, HSADC_CHANNEL_DCBIAS, HSADC_CHANNEL_NODCBIAS);
	Chip_HSADC_SetPowerSpeed(LPC_ADCHS, false);
	Chip_HSADC_EnablePower(LPC_ADCHS);
	Chip_HSADC_SetupDescEntry(LPC_ADCHS, 0, 0, (HSADC_DESC_CH(0) | HSADC_DESC_BRANCH_FIRST | HSADC_DESC_MATCH(1) | HSADC_DESC_THRESH_NONE | HSADC_DESC_RESET_TIMER));
	Chip_HSADC_EnableInts(LPC_ADCHS, 0, (HSADC_INT0_FIFO_FULL));
	Chip_HSADC_UpdateDescTable(LPC_ADCHS, 0);
	NVIC_EnableIRQ(ADCHS_IRQn);
}&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 19 Apr 2023 18:15:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-DMA-P2M-Too-Much-Data-Transferred/m-p/1636481#M52255</guid>
      <dc:creator>rulamp</dc:creator>
      <dc:date>2023-04-19T18:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: LPC4370 - DMA P2M Too Much Data Transferred</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-DMA-P2M-Too-Much-Data-Transferred/m-p/1636868#M52260</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;
&lt;P&gt;Can you refer to the ticket?&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-DMA-Issues/m-p/1636485#M52256" target="_blank" rel="noopener"&gt;https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-DMA-Issues/m-p/1636485#M52256&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the hsadc example in LPCopen, the ADC uses software&amp;nbsp; triggering, it can not reach up to 80MSPS.&lt;/P&gt;
&lt;P&gt;Hope it can help you&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;XiangJun Rong&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2023 06:56:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-DMA-P2M-Too-Much-Data-Transferred/m-p/1636868#M52260</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2023-04-21T06:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: LPC4370 - DMA P2M Too Much Data Transferred</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-DMA-P2M-Too-Much-Data-Transferred/m-p/1637432#M52268</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;XiangJun,&lt;BR /&gt;&lt;BR /&gt;Maybe I am confused and do not understand you, but I think you might be confused and mixing up my question. I did not say anything in this post about 80MS/s. I did not say anything in this post about problems with the HSADC.&lt;BR /&gt;Yes, I understand that the example uses a software trigger executed in a timer interrupt. I am NOT asking about the example, though. I am asking about my code. As you can see in the descriptor entry, I branch to FIRST. This causes the ADC to run continuously. The works correctly.&lt;BR /&gt;&lt;BR /&gt;My question is about DMA. My question is:&lt;BR /&gt;Why does the destination address continue to increment upon a new DMA transfer? The destination address should be dest[0], however, it is greater than dest[(16*num_of_transfers)].&lt;BR /&gt;&lt;BR /&gt;Why is this happening? Again, I am NOT asking about ADC functionality.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Apr 2023 01:30:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-DMA-P2M-Too-Much-Data-Transferred/m-p/1637432#M52268</guid>
      <dc:creator>rulamp</dc:creator>
      <dc:date>2023-04-22T01:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: LPC4370 - DMA P2M Too Much Data Transferred</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-DMA-P2M-Too-Much-Data-Transferred/m-p/1637879#M52282</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have checked your code, in the DMA_IRQHandler (), you reinitialize the LPC_GPDMA-&amp;gt;CH[dmaCh].DESTADDR&lt;/P&gt;
&lt;P&gt;with the line.&lt;/P&gt;
&lt;P&gt;LPC_GPDMA-&amp;gt;CH[dmaCh].DESTADDR = ((uint32_t) &amp;amp;dest[0]);&lt;/P&gt;
&lt;P&gt;So, pls check if you have entered the DMA_IRQHandler ()&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;XiangJun Rong&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2023 08:29:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-DMA-P2M-Too-Much-Data-Transferred/m-p/1637879#M52282</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2023-04-21T08:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: LPC4370 - DMA P2M Too Much Data Transferred</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-DMA-P2M-Too-Much-Data-Transferred/m-p/1638265#M52290</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;Thank you for checking my code. Yes, I can confirm that my code enters, executes, and then exits the DMA_IRQHandler properly.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2023 22:13:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-DMA-P2M-Too-Much-Data-Transferred/m-p/1638265#M52290</guid>
      <dc:creator>rulamp</dc:creator>
      <dc:date>2023-04-21T22:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: LPC4370 - DMA P2M Too Much Data Transferred</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-DMA-P2M-Too-Much-Data-Transferred/m-p/1643345#M52359</link>
      <description>&lt;P&gt;Hello. Checking in to see if you have any other ideas as to the cause of the behavior?&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2023 01:57:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4370-DMA-P2M-Too-Much-Data-Transferred/m-p/1643345#M52359</guid>
      <dc:creator>rulamp</dc:creator>
      <dc:date>2023-05-03T01:57:46Z</dc:date>
    </item>
  </channel>
</rss>

