取消
显示结果 
搜索替代 
您的意思是: 
Highlighted
Adventurer
Adventurer
318 次查看
注册日期: ‎12-12-2018

sds _alloc在zcu104中运行出错

转到解答

 

	int rows = leftimage.rows;
	int cols = rightimage.cols;
	int R = 64;
	int FWD_INV = 0;
	int rowNum, colNum;
	rowNum = (rows + R * 2 - 1) / (R * 2);//5
	colNum = (cols + R * 2 - 1) / (R * 2);//9
	printf("the image height is %d,width is %d !\n",rows,cols);//606,1061

	float * l_real = (float *) sds_alloc(sizeof(float) * 2 * R * 2 * R * rowNum * colNum);
	float * l_imag = (float *) sds_alloc(sizeof(float) * 2 * R * 2 * R * rowNum * colNum);
	float * r_real = (float *) sds_alloc(sizeof(float) * 2 * R * 2 * R * rowNum * colNum);
	float * r_imag = (float *) sds_alloc(sizeof(float) * 2 * R * 2 * R * rowNum * colNum);

	memset(l_real, 0, sizeof(float) * 2 * R * 2 * R * rowNum * colNum);
	memset(l_imag, 0, sizeof(float) * 2 * R * 2 * R * rowNum * colNum);
	memset(r_real, 0, sizeof(float) * 2 * R * 2 * R * rowNum * colNum);
	memset(r_imag, 0, sizeof(float) * 2 * R * 2 * R * rowNum * colNum);

	printf("rownum = %d   ,colnum = %d",rowNum,colNum);

为何我的这个程序在开发板上运行报错:

 

root@xilinx-zcu104-2018_3:/mnt# ./fft_single.elf
the image height is 606,width is 1061 !
ERROR: DMASIMPLE could not find physical address for buffer - mak[  107.868146] CPU: 3 PID: 2295 Comm: fft_single.elf Tainted: G           O    4.14.0 #1
e sure the buffer is allocated with sds_alloc
[  107.881525] Hardware name: ZynqMP ZCU104 RevC (DT)
[  107.890365] task: ffffffc05d286400 task.stack: ffffff800bea8000
[  107.896275] PC is at 0x7fafe8b7a8
[  107.899583] LR is at 0x403a88
[  107.902544] pc : [<0000007fafe8b7a8>] lr : [<0000000000403a88>] pstate: 60000000
[  107.909928] sp : 0000007fc30d95a0
[  107.913237] x29: 0000007fc30d95a0 x28: 0000000000000000 
[  107.918540] x27: 0000007fae3c4000 x26: 0000007fae3c3000 
[  107.923851] x25: 0000007fc30d975f x24: 0000000000418000 
[  107.929155] x23: 0000000000418000 x22: 0000000000418000 
[  107.934465] x21: 0000000000418000 x20: 0000000000418000 
[  107.939771] x19: 0000000000000000 x18: 000000000000005f 
[  107.945082] x17: 0000007fafe8b798 x16: 0000000000418168 
[  107.950391] x15: 0000007fafe869b8 x14: 0000007fafe88500 
[  107.955699] x13: 0000000000000000 x12: 0000007faefa3bb1 
[  107.961001] x11: 0000000000000000 x10: 0101010101010101 
[  107.966305] x9 : ffffff80ffffffc8 x8 : 000000000000001d 
[  107.971617] x7 : 0000007fafea8470 x6 : 0000007fafea8470 
[  107.976921] x5 : 000000005fc4e000 x4 : 0000000000000001 
[  107.982231] x3 : 00000000144abf20 x2 : 0000000000000010 
[  107.987537] x1 : 0000007fb08cc0b0 x0 : 0000000000000000 
Segmentation fault

为什么执行到sds内存申请就报错了,我程序没问题啊

 

 

0 项奖励
1 个已接受解答

已接受的解答
Highlighted
Adventurer
Adventurer
268 次查看
注册日期: ‎12-12-2018

回复: sds _alloc在zcu104中运行出错

转到解答

项目时间很紧,总是出现各种问题,这个问题是由于下面使用所申请的内存时,出现空,或者超范围的数组引起的。

在原帖中查看解决方案

0 项奖励
1 条回复1
Highlighted
Adventurer
Adventurer
269 次查看
注册日期: ‎12-12-2018

回复: sds _alloc在zcu104中运行出错

转到解答

项目时间很紧,总是出现各种问题,这个问题是由于下面使用所申请的内存时,出现空,或者超范围的数组引起的。

在原帖中查看解决方案

0 项奖励