如何设置DMA优先级

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

如何设置DMA优先级

922 Views
qiurenguo
Contributor I

目前设备运行lcdif和SPI DMA,SPI使用PIT 2.5us触发一次dma采集

问题:

     DMA触发理论上应该要2.5us产生一个片选采集信号,但是目前会有0.5us的飘动,有时候2us,有时候3us,后面发现是LCDIF影响的,通过配置DMA优先级有问题,帮忙看下这个DMA优先级异常

```

edma_channel_Preemption_config_t edma_pconfig;
edma_pconfig.enableChannelPreemption = false;
edma_pconfig.enablePreemptAbility = true;
edma_pconfig.channelPriority = 15;
EDMA_SetChannelPreemptionConfig(EXAMPLE_LPSPI_MASTER_DMA_BASE, EXAMPLE_LPSPI_MASTER_DMA_TX_CHANNEL,
&edma_pconfig);

edma_pconfig.enableChannelPreemption = true;
edma_pconfig.enablePreemptAbility = true;
edma_pconfig.channelPriority = 14;
EDMA_SetChannelPreemptionConfig(EXAMPLE_LPSPI_MASTER_DMA_BASE, EXAMPLE_LPSPI_MASTER_DMA_RX_CHANNEL,
&edma_pconfig);

```

全部代码见附件

 

 

0 Kudos
7 Replies

848 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @qiurenguo ,

enableChannelPreemption的意思是能否被挤占,channelPriority是优先级,越大越高。

AD采样的话应该是EXAMPLE_LPSPI_MASTER_DMA_RX_CHANNEL,应该是不可被挤占,更高优先级。

 

Regards,

Jing

0 Kudos

806 Views
qiurenguo
Contributor I

AD是AD4008芯片,SPI接口,使用DMA读取数据,同时板子使用了LCDIF,这个默认也是DMA,如果开启LCDIF,就会导致PIT触发SPI DMA读取值间隔发生变化,理论应该是2.5us产生一次DMA采集,但是实际会有0.5us变化,如果关闭LCDIF就正常了

0 Kudos

797 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @qiurenguo ,

LCD DMA是否真的被剥夺?

0 Kudos

795 Views
qiurenguo
Contributor I

这个怎么查?

0 Kudos

905 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

哪颗芯片

0 Kudos

865 Views
qiurenguo
Contributor I
RT1052
0 Kudos

902 Views
qiurenguo
Contributor I
RT1052
0 Kudos