AnsweredAssumed Answered

BF609 PIXC DMA LIST 读取错误。

Question asked by qian on Nov 29, 2013
Latest reply on Nov 29, 2013 by qian

BF609 PIXC DMA LIST 读取错误。

 

 

 

 

我的链表配置方式如下:

 

 

/* DMA descriptor work unit for PDMA */

typedef struct

{

    volatile void       *pNextDesc;         /* Pointer to next Descriptor */

    volatile void       *pStartAddr;        /* Start address of current buffer */

    volatile uint32_t   Config;             /* Configuration register */

    volatile uint32_t   XCount;             /* XCOUNT - Inner loop count start value in number of MSIZE data transfers*/

    volatile int32_t    XModify;            /* XMODIFY - Inner loop address increment, in bytes */

    volatile uint32_t   YCount;             /* YCOUNT - Outer loop count start value (2D only), in number of rows*/

    volatile int32_t    YModify;            /* YMODIFY - Outer loop address increment (2D only), in bytes*/

} PDMA_DESC_WORK_UNIT;

 

 

 

 

#pragma section("L1_data")

#pragma align 32

PDMA_DESC_WORK_UNIT OSD_DMA35_DescriptorCopy[6];

 

 

void dma35List(void)

{

OSD_DMA35_DescriptorCopy[0].pNextDesc                     = &OSD_DMA35_DescriptorCopy[1];// 下一个描述符地址

          //OSD_DMA15_DescriptorCopy[0].Config                              = DMAEN | WDSIZE_32 | DMA2D | NDSIZE_9 | FLOW_LARGE;// DMA config

          OSD_DMA35_DescriptorCopy[0].Config                              = ENUM_DMA_CFG_READ    |

                                                                                                                          ENUM_DMA_CFG_EN             |

                                                                                                                          ENUM_DMA_CFG_MSIZE04 |

                                                                                                                          ENUM_DMA_CFG_PSIZE04 |

                                                                                                                          ENUM_DMA_CFG_ADDR2D  |

                                                                                                                          ENUM_DMA_CFG_FETCH07 |

                                                                                                                          ENUM_DMA_CFG_DSCLIST;

          OSD_DMA35_DescriptorCopy[0].XCount                              = 640*2/4;                              // X Count

          OSD_DMA35_DescriptorCopy[0].XModify                              = 4;                                        // X Mod

          OSD_DMA35_DescriptorCopy[0].YCount                              = (512-32)/2;                    // Y Count

          OSD_DMA35_DescriptorCopy[0].YModify                              = (720-640)*2+4;

 

 

          OSD_DMA35_DescriptorCopy[1].pNextDesc                     = &OSD_DMA35_DescriptorCopy[2];// 下一个描述符地址

          //OSD_DMA15_DescriptorCopy[1].Config                    = DMAEN | WDSIZE_32 | DMA2D | NDSIZE_9 | FLOW_LARGE;// DMA config

          OSD_DMA35_DescriptorCopy[1].Config                              = ENUM_DMA_CFG_READ    |

                                                                                                                          ENUM_DMA_CFG_EN             |

                                                                                                                          ENUM_DMA_CFG_MSIZE04 |

                                                                                                                          ENUM_DMA_CFG_PSIZE04 |

                                                                                                                          ENUM_DMA_CFG_ADDR2D  |

                                                                                                                          ENUM_DMA_CFG_FETCH07 |

                                                                                                                          ENUM_DMA_CFG_DSCLIST;

          OSD_DMA35_DescriptorCopy[1].XCount                              = ((640-32)/2)*2/4;          // X Count

          OSD_DMA35_DescriptorCopy[1].XModify                              = 4;                                        // X Mod

          OSD_DMA35_DescriptorCopy[1].YCount                              = 32;                                        // Y Count

          OSD_DMA35_DescriptorCopy[1].YModify                              = (720-((640-32)/2))*2+4;

 

 

          OSD_DMA35_DescriptorCopy[2].pNextDesc                     = &OSD_DMA35_DescriptorCopy[3];// 下一个描述符地址

          //OSD_DMA15_DescriptorCopy[2].Config                    = DMAEN | WDSIZE_32 | DMA2D | NDSIZE_9 | FLOW_LARGE;// DMA config

          OSD_DMA35_DescriptorCopy[2].Config                              = ENUM_DMA_CFG_READ    |

                                                                                                                          ENUM_DMA_CFG_EN             |

                                                                                                                          ENUM_DMA_CFG_MSIZE04 |

                                                                                                                          ENUM_DMA_CFG_PSIZE04 |

                                                                                                                          ENUM_DMA_CFG_ADDR2D  |

                                                                                                                          ENUM_DMA_CFG_FETCH07 |

                                                                                                                          ENUM_DMA_CFG_DSCLIST;

          OSD_DMA35_DescriptorCopy[2].XCount                              = ((640-32)/2)*2/4;          // X Count

          OSD_DMA35_DescriptorCopy[2].XModify                              = 4;                                        // X Mod

          OSD_DMA35_DescriptorCopy[2].YCount                              = 32;                                        // Y Count

          OSD_DMA35_DescriptorCopy[2].YModify                              = (720-((640-32)/2))*2+4;

 

 

          OSD_DMA35_DescriptorCopy[3].pNextDesc                     = &OSD_DMA35_DescriptorCopy[4];// 下一个描述符地址

//          OSD_DMA15_DescriptorCopy[3].Config                              = DMAEN | WDSIZE_32 | DMA2D | NDSIZE_9 | FLOW_LARGE;// DMA config

          OSD_DMA35_DescriptorCopy[3].Config                              = ENUM_DMA_CFG_READ    |

                                                                                                                          ENUM_DMA_CFG_EN             |

                                                                                                                          ENUM_DMA_CFG_MSIZE04 |

                                                                                                                          ENUM_DMA_CFG_PSIZE04 |

                                                                                                                          ENUM_DMA_CFG_ADDR2D  |

                                                                                                                          ENUM_DMA_CFG_FETCH07 |

                                                                                                                          ENUM_DMA_CFG_DSCLIST;

          OSD_DMA35_DescriptorCopy[3].XCount                              = 640*2/4;                              // X Count

          OSD_DMA35_DescriptorCopy[3].XModify                              = 4;                                        // X Mod

          OSD_DMA35_DescriptorCopy[3].YCount                              = (512-32)/2-128;          // Y Count

          OSD_DMA35_DescriptorCopy[3].YModify                              = (720-640)*2+4;

 

 

          OSD_DMA35_DescriptorCopy[4].pNextDesc                     = &OSD_DMA35_DescriptorCopy[5];// 下一个描述符地址

//          OSD_DMA15_DescriptorCopy[4].Config                              = DMAEN | WDSIZE_32 | DMA2D | NDSIZE_9 | FLOW_LARGE;// DMA config

          OSD_DMA35_DescriptorCopy[4].Config                              = ENUM_DMA_CFG_READ    |

                                                                                                                          ENUM_DMA_CFG_EN             |

                                                                                                                          ENUM_DMA_CFG_MSIZE04 |

                                                                                                                          ENUM_DMA_CFG_PSIZE04 |

                                                                                                                          ENUM_DMA_CFG_ADDR2D  |

                                                                                                                          ENUM_DMA_CFG_FETCH07 |

                                                                                                                          ENUM_DMA_CFG_DSCLIST;

          OSD_DMA35_DescriptorCopy[4].XCount                              = (640-160)*2/4;          // X Count

          OSD_DMA35_DescriptorCopy[4].XModify                              = 4;                                        // X Mod

          OSD_DMA35_DescriptorCopy[4].YCount                              = 128;                                        // Y Count

          OSD_DMA35_DescriptorCopy[4].YModify                              = (720-(640-160))*2+4;

          //与开窗重合

          OSD_DMA35_DescriptorCopy[5].pNextDesc                     = &OSD_DMA35_DescriptorCopy[5];// 下一个描述符地址

//          OSD_DMA15_DescriptorCopy[5].Config                              = DMAEN | WDSIZE_32 | DMA2D | FLOW_STOP;// DMA config  结束

          OSD_DMA35_DescriptorCopy[5].Config                              = ENUM_DMA_CFG_READ    |

                                                                                                                          ENUM_DMA_CFG_EN             |

                                                                                                                          ENUM_DMA_CFG_MSIZE04 |

                                                                                                                          ENUM_DMA_CFG_PSIZE04 |

                                                                                                                          ENUM_DMA_CFG_ADDR2D  |

                                                                                                                          ENUM_DMA_CFG_STOP;

          OSD_DMA35_DescriptorCopy[5].XCount                              = 160*2/4;                              // X Count

          OSD_DMA35_DescriptorCopy[5].XModify                              = 4;                                        // X Mod

          OSD_DMA35_DescriptorCopy[5].YCount                              = 128;                                        // Y Count

          OSD_DMA35_DescriptorCopy[5].YModify                              = (720-160)*2+4;

 

 

}

 

 

 

 

void pixc_cfg(void)

{

 

 

          *pREG_PIXC0_TRANSP_A = TranspRatio;//透明度 0~F--50%

 

 

          *pREG_PIXC0_PPL = 1276;//行内计数

          *pREG_PIXC0_LPF = 256;//逐行叠加

 

 

          *pREG_PIXC0_HSTART_A = 0;//行开始

          *pREG_PIXC0_HEND_A = 1276+1;//行结束

          *pREG_PIXC0_VSTART_A = 0;//垂直开始

          *pREG_PIXC0_VEND_A = 256;//垂直结束

 

 

          //*pPIXC_CTL =  TC_EN;//不叠加OSD 只复制

          *pREG_PIXC0_CTL =  BITM_PIXC_CTL_ENTC;//不叠加OSD 只复制

 

 

 

 

          *pREG_DMA35_DSCPTR_NXT=(&OSD_DMA35_DescriptorCopy[0]);

          *pREG_DMA37_DSCPTR_NXT=(&OSD_DMA37_DescriptorCopy[0]);

 

 

 

 

          if((*pREG_DMA37_STAT &BITM_DMA_STAT_RUN)==0)//判断输出DMA状态

          {

                    //开启使能 必须先开启DMA

//                    *pDMA15_CONFIG = DMAEN | NDSIZE_9 | FLOW_LARGE;// DMA config

//                    *pDMA17_CONFIG = DMAEN | NDSIZE_9 | FLOW_LARGE;// DMA config

                    *pREG_DMA35_CFG  =          ENUM_DMA_CFG_READ   |

                                                                      ENUM_DMA_CFG_EN |

                                                                      ENUM_DMA_CFG_FETCH07 |

                                                                      ENUM_DMA_CFG_ADDR2D |

                                                                      ENUM_DMA_CFG_DSCLIST;

 

 

                    *pREG_DMA37_CFG  =          ENUM_DMA_CFG_WRITE   |

                                                                      ENUM_DMA_CFG_EN |

                                                                      ENUM_DMA_CFG_FETCH07 |

                                                                      ENUM_DMA_CFG_ADDR2D |

                                                                      ENUM_DMA_CFG_DSCLIST;

                    ssync();

                    //使能PIXC

                    //*pPIXC_CTL |= PIXC_EN;

                    *pREG_PIXC0_CTL |= BITM_PIXC_CTL_EN;

                    ssync();

          }

 

 

}

 

 

当使能PIXC以后。

DMA35_37_STAT都有错误:0X00006002

 

 

寄存器截图为:

无标题.jpg

 

我无法找到DMA错误的原因。

Outcomes