当前位置: 代码迷 >> WinCE >> 2440 摄像头驱动DMA使用有关问题
  详细解决方案

2440 摄像头驱动DMA使用有关问题

热度:557   发布时间:2016-04-28 13:48:45.0
2440 摄像头驱动DMA使用问题
C/C++ code
我使用GPIO模拟IIC初始化OV9652 已经成功(我读出来和写入数值一致)并且用应用程序打开摄像头驱动时候,摄像头驱动也已经能够不停的产生中断。但是不知道怎么回事,但是图像死活不出现。——我用老的BSP 编译出NK 摄像头可以正常采集,排除了硬件问题。但是我把老的BSP的代码搬到5.0 却死活不出图像了。我推测是DMA问题,我根据内存映射表修改了一番,可是还是没有结果。我的内存映射表g_oalAddressTable        DCD     0x80000000, 0x30000000, 64      ; 32 MB DRAM BANK 6        DCD     0x84000000, 0x10000000, 32      ; nGCS2: PCMCIA/PCCARD        DCD     0x86000000, 0x18000000, 32      ; 32 MB SROM(SRAM/ROM) BANK 3        DCD     0x88000000, 0x20000000, 32      ; 32 MB SROM(SRAM/ROM) BANK 4        DCD     0x8A000000, 0x28000000, 32      ; 32 MB SROM(SRAM/ROM) BANK 5        DCD     0x8C000000, 0x08000000, 32      ; 32 MB SROM(SRAM/ROM) BANK 1        DCD     0x90800000, 0x48000000,  1      ; Memory control register        DCD     0x90900000, 0x49000000,  1      ; USB Host register        DCD     0x90A00000, 0x4A000000,  1      ; Interrupt Control register        DCD     0x90B00000, 0x4B000000,  1      ; DMA control register        DCD     0x90C00000, 0x4C000000,  1      ; Clock & Power register        DCD     0x90D00000, 0x4D000000,  1      ; LCD control register        DCD     0x90E00000, 0x4E000000,  1      ; NAND flash control register        DCD     0x90F00000, 0x4F000000,  1      ; Camera control register    DCD     0x91000000, 0x50000000,  1      ; UART control register        DCD     0x91100000, 0x51000000,  1      ; PWM timer register        DCD     0x91200000, 0x52000000,  1      ; USB device register        DCD     0x91300000, 0x53000000,  1      ; Watchdog Timer register        DCD     0x91400000, 0x54000000,  1      ; IIC control register        DCD     0x91500000, 0x55000000,  1      ; IIS control register        DCD     0x91600000, 0x56000000,  1      ; I/O Port register        DCD     0x91700000, 0x57000000,  1      ; RTC control register        DCD     0x91800000, 0x58000000,  1      ; A/D convert register        DCD     0x91900000, 0x59000000,  1      ; SPI register        DCD     0x91A00000, 0x5A000000,  1      ; SD Interface register        DCD     0x92000000, 0x00000000, 32      ; 32 MB SROM(SRAM/ROM) BANK 0        DCD     0x94D00000, 0x34000000, 64      ; 64 MB SDRAM BANK 6——我使用的128M SDRAM 非连续方法扩展        DCD     0x00000000, 0x00000000,  0      ; end of table我的config.bib的DMA内存设置。MEMORY    NK      80200000  01E00000  RAMIMAGE    RAM     82000000  02000000  RAM    FLASH   92000000  00100000  RESERVED; Common RAM areas    AUD_DMA             80002000  00000800  RESERVED     SDIO_DMA            80010000  00010000  RESERVED    ARGS                80020800  00000800  RESERVED    DBGSER_DMA          80022000  00002000  RESERVED    SER_DMA             80024000  00002000  RESERVED    IR_DMA              80026000  00002000  RESERVED    SLEEP               80028000  00002000    RESERVED    EDBG                80030000  00020000  RESERVED;    DISPLAY            80100000  00100000  RESERVED; camera DMA 用于摄像头DMA    CAMERA                80050000  00110000  RESERVED     DISPLAY             84800000  00100000  RESERVED    CAMERA_CODE        84000000  00800000  RESERVED 在camera驱动中我是这么定义的//----------------------------------yl2440 4.2-->5.0 BSP 's set---------------------------// 1st Ping-pong Address#define COPIFRAMEBUFFER_A     0x30050000    // 320*240 * 2(RGB 16bit) * 4 frames = 614400 = 0x96000// 0x30030000 + 0x96000 = 0x300c6000//#define COPIFRAMEBUFFER_B     0x32000000    // Max buffer size of Port : 0x1c2000 (640*480+640*480*2/4)*4#define COPIFRAMEBUFFER_B     0x34000000    // 0x32000000-->0x34000000//要把CODE通道DMA地址放到不影响其他部分运行的RAM地址#define VIRTUAL_OFFSET        0x7C000000#define VIRTUAL_ADDR_OFFSET    VIRTUAL_OFFSET // for MPEG4中断的线程已经不停的执行,调用了    Display_Cam_Image(0,0, 240, 240, PORT_A);这明明是用来显示的,但是怎么会不出图像呢?请做过的前辈指导一下。


------解决方案--------------------
dma 的配置、启用、停止很简单,使用物理地址,网卡、硬盘等经常使用...