LPC4300 DMA scatter/gatter with LLI

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC4300 DMA scatter/gatter with LLI

325 Views
robberpen
Contributor III

Hi

I am trying enabled burst DMA for hsadc.

It work as DMA as flow-control(0x2), but I need peripheral flow-control (0x6) for more efficiently. here will some items not clear. is any one have comment with red color part.

 

  LPC_GPDMA->CH[DMA_CH].SRCADDR = (uint32_t) &LPC_ADCHS->FIFO_OUTPUT[0];

  LPC_GPDMA->CH[DMA_CH].DESTADDR = (uint32_t) sample);  // should I set to zero
  LPC_GPDMA->CH[DMA_CH].CONTROL = (DMA_TRANSFER_SIZE)  ç  programming guide said peripheral flow control(0x6) will ignore this field,However when set to 0, nothing FIFO data been transferred

  | (0x0 << 12)

  | (0x0 << 15) // dst burst

  | (0x2 << 18) // src傳輸寬度,0x2表示以字的形式傳輸

  | (0x2 << 21) // dst傳輸寬度,0x2表示以字的形式傳輸

  | (0x1 << 24) // src AHB主選擇

  | (0x0 << 25) // dst AHB主選擇

  | (0x0 << 26) // src增量:0,每次傳輸後src位址不遞增

  | (0x1 << 27) // dst增量:1,每次傳輸後的dst位址增量

  | (0x1 << 31); //What is Terminal count interrupt

  LPC_GPDMA->CH[DMA_CH].CONFIG = (0x0 << 0) // channel eabled ç burst mode is set to 0?

  | (HSADC_DMA_READ << 1) // src外設:設置為8-HSADC

  | (0x0 << 6) // dst外設:無設置-記憶體

  | (0x6 << 11) //流控制:外設-記憶體(0x2 working),XXX -  Now test 0x6

  | (0x1 << 14) // IE-中斷錯誤遮罩

  | (0x1 << 15) //  ITC-ç The impact is not clear

  | (0x0 << 16) //lock ç The impact is not clear

  | (0x0 << 18); //進一步忽略src DMA req  ç Confirming.

  LPC_GPDMA->CH[DMA_CH].LLI = LLI_Table;  ç How to make DMA reload LLI automatically

 

Labels (1)
0 Kudos
Reply
3 Replies

265 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @robberpen 

1. - DESTADDR = (uint32_t) sample
- This should **not be set to zero**. You need to provide a valid memory address to store the HSADC samples

2. CONTROL = DMA_TRANSFER_SIZE: This shouldn't be `0`. Try setting this to the expected number of data units (words/bytes) to transfer.

3. CONFIG = (0x0 << 0)` (channel enabled) This field needs to be set to `1` to enable the DMA channel. You might be referring to **burst mode**, but this field is used to enable the channel itself, not control the burst mode.

4.LPC_GPDMA->CH[DMA_CH].LLI = LLI_Table
- To make DMA **automatically reload the LLI**, ensure the `LLI` field points to the next descriptor. Each LLI must contain the address of the next LLI in the chain or `0` if it's the last one.

BR

Hang

0 Kudos
Reply

256 Views
robberpen
Contributor III

Hi @Harry_Zhang 

Thanks your reply, I will verifying your comment.

Based from the doc below, TRANSERSIZE not use if the DMA Controller is not the flow controller.

So the DMA how to know the buffer size should be copied in each continuously DMA burst request.

I supposedly the scatter/gatter with LLI mechanism is not work if flow controller is not DMA, Please have comment

robberpen_0-1726759581562.png

 

0 Kudos
Reply

232 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @robberpen 

Based on the documentation snippet you provided, the TRANSFERSIZE field in the DMA Channel Control register is indeed not used if the DMA Controller is not the flow controller. This implies that when the peripheral or another component is controlling the flow, the TRANSFERSIZE field does not dictate the size of the transfer.

BR

Hang

0 Kudos
Reply