|
但是现在有个问题,就是利用摄像头驱动中的XX_IOControl函数提供的Copy_Cam_Image()函数把RGB格式的图像缓存值拷贝到制定地方时,会出现"Data Abort"异常。
Copy_Cam_Image()函数如下:
- void Copy_Cam_Image(U8 *pBufOut, U32 size_x, U32 size_y, U8 port)
- {
- U8 *buffer_rgb,*pImage;
- U32 y;
- int temp,pic_size;
- RETAILMSG(MSG_EN_1,(_T("++Copy_Cam_Image().\n"))); //add by Rn 20090330
- pic_size = size_x*size_y*2; //this is use 176*144*2
- pImage = pBufOut;
-
- {
- temp = (s2440CAM->rCIPRSTATUS>>26)&3; //FrameCnt_Pr&3
- temp = (temp + 2) % 4;
-
- switch (temp)
- {
- case 0:
- buffer_rgb = (U8 *)s2440CAM->rCIPRCLRSA1; //RGB 1st frame start address for preview DMA
- break;
- case 1:
- buffer_rgb = (U8 *)s2440CAM->rCIPRCLRSA2; //RGB 2st frame start address for preview DMA
- break;
- case 2:
- buffer_rgb = (U8 *)s2440CAM->rCIPRCLRSA3; //RGB 3st frame start address for preview DMA
- break;
- case 3:
- buffer_rgb = (U8 *)s2440CAM->rCIPRCLRSA4; //RGB 4st frame start address for preview DMA
- break;
- default :
- buffer_rgb = (U8 *)s2440CAM->rCIPRCLRSA1;
- break;
- }
-
- }
-
- RETAILMSG(MSG_EN_1,(_T("Copy_Cam_Image:temp is %d.\r\n"), temp)); //add by Rn 20090330
- //出现“”异常的代码锁定为以下红色字体部分
- [color=#FF0000]#if (DOTNET_DRIVER) //文件开头有定义(#define DOTNET_DRIVER 1 // 0:PPC, 1:CE.NET)
- SetKMode(TRUE);
- #endif
- buffer_rgb += VIRTUAL_OFFSET; //VIRTUAL_OFFSET=0x7C000000~camif.h
-
- memcpy(pImage, buffer_rgb, pic_size); //pImage=pBufOut;pic_size = size_x*size_y*2;
- #if (DOTNET_DRIVER)
- SetKMode(FALSE);
- #endif[/color]
- RETAILMSG(MSG_EN_1,(_T("--Copy_Cam_Image().\n"))); //add by Rn 20090330
- }
复制代码
串口调试得到的异常信息如下:
Data Abort: Thread=8f9f02b4 Proc=8db96160 'device.exe'
AKY=00000045 PC=03fc3ac8(coredll.dll+0x00053ac8) RA=028630e8(camera.dll+0x000030e8) BVA=06000000 FSR=00000007
RaiseException: Thread=8f9f02b4 Proc=8db96160 'device.exe'
AKY=00000045 PC=03f8dff4(coredll.dll+0x0001dff4) RA=8c22a61c(NK.EXE+0x0002a61c) BVA=00000003 FSR=00000003
Data Abort: Thread=8f9f02b4 Proc=8db96520 'OV9650Test.exe'
AKY=00000041 PC=03f929f4(coredll.dll+0x000229f4) RA=50616548(???+0x50616548) BVA=0e000051 FSR=00000003
请教各位高手!谢谢 |
|