UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Observer eddylee
Observer
1,025 Views
Registered: ‎11-21-2017

xilinx answer 65444 - dma_to_device: dma_to_device.c:173: test_dma: Assertion `rc == size' failed

Hello, I download xilinx answer 65444 and I follow the ''Usage'' section flow of readme.txt file.
When I execute run_test.sh file, I meet problem below.

Can anyone help me to fix it?  Thank you for your advice!

 

I modify the transfer size value from 1024 to 8192 of run_test.sh file and it test pass when transfer size value is 1024.

I do not know what the wrong message means.

 

[root@localhost tests]# ./run_test.sh
Info: Number of enabled h2c channels = 1
Info: Number of enabled c2h channels = 1
Info: The PCIe DMA core is memory mapped.
Info: Running PCIe DMA memory mapped write read test
transfer size: 8192
transfer count: 1

Info: Writing to h2c channel 0 at address offset 0.
Info: Wait for current transactions to complete.
sscanf() = 1, value = 0x00002000
sscanf() = 1, value = 0x00000000
sscanf() = 1, value = 0x00000001
device = /dev/xdma0_h2c_0, address = 0x00000000, size = 0x00002000, offset = 0x00000000, count = 1
host memory buffer = 0x1e03000

read(file_fd): Success
dma_to_device: dma_to_device.c:173: test_dma: Assertion `rc == size' failed.
./scripts/dma_memory_mapped_test.sh: line 33: 4118 Aborted (core dumped) ./dma_to_device -d /dev/xdma0_h2c_${curChannel} -f data/datafile${i}_4K.bin -s $transferSize -a $addrOffset -c $transferCount

 

Info: Writing to h2c channel 0 at address offset 8192.
Info: Wait for current transactions to complete.
sscanf() = 1, value = 0x00002000
sscanf() = 1, value = 0x00002000
sscanf() = 1, value = 0x00000001
device = /dev/xdma0_h2c_0, address = 0x00002000, size = 0x00002000, offset = 0x00000000, count = 1
host memory buffer = 0x1fb0000
read(file_fd): Success
dma_to_device: dma_to_device.c:173: test_dma: Assertion `rc == size' failed.
./scripts/dma_memory_mapped_test.sh: line 33: 4122 Aborted (core dumped) ./dma_to_device -d /dev/xdma0_h2c_${curChannel} -f data/datafile${i}_4K.bin -s $transferSize -a $addrOffset -c $transferCount

 

Info: Writing to h2c channel 0 at address offset 16384.
Info: Wait for current transactions to complete.
sscanf() = 1, value = 0x00002000
sscanf() = 1, value = 0x00004000
sscanf() = 1, value = 0x00000001
device = /dev/xdma0_h2c_0, address = 0x00004000, size = 0x00002000, offset = 0x00000000, count = 1
host memory buffer = 0xcbf000
read(file_fd): Success
dma_to_device: dma_to_device.c:173: test_dma: Assertion `rc == size' failed.
./scripts/dma_memory_mapped_test.sh: line 33: 4125 Aborted (core dumped) ./dma_to_device -d /dev/xdma0_h2c_${curChannel} -f data/datafile${i}_4K.bin -s $transferSize -a $addrOffset -c $transferCount

 

Info: Writing to h2c channel 0 at address offset 24576.
Info: Wait for current transactions to complete.
sscanf() = 1, value = 0x00002000
sscanf() = 1, value = 0x00006000
sscanf() = 1, value = 0x00000001
device = /dev/xdma0_h2c_0, address = 0x00006000, size = 0x00002000, offset = 0x00000000, count = 1
host memory buffer = 0xab5000
read(file_fd): Success
dma_to_device: dma_to_device.c:173: test_dma: Assertion `rc == size' failed.
./scripts/dma_memory_mapped_test.sh: line 33: 4127 Aborted (core dumped) ./dma_to_device -d /dev/xdma0_h2c_${curChannel} -f data/datafile${i}_4K.bin -s $transferSize -a $addrOffset -c $transferCount

 

Info: Reading from c2h channel 0 at address offset 0.
Info: Wait for the current transactions to complete.
sscanf() = 1, value = 0x00002000
sscanf() = 1, value = 0x00000000
sscanf() = 1, value = 0x00000001
device = /dev/xdma0_c2h_0, address = 0x00000000, size = 0x00002000, offset = 0x00000000, count = 1
host memory buffer = 0xd44000
CLOCK_MONOTONIC reports 0.000043398 seconds (total) for last transfer of 8192 bytes

 

Info: Reading from c2h channel 0 at address offset 8192.
Info: Wait for the current transactions to complete.
sscanf() = 1, value = 0x00002000
sscanf() = 1, value = 0x00002000
sscanf() = 1, value = 0x00000001
device = /dev/xdma0_c2h_0, address = 0x00002000, size = 0x00002000, offset = 0x00000000, count = 1
host memory buffer = 0x2398000
CLOCK_MONOTONIC reports 0.000049757 seconds (total) for last transfer of 8192 bytes

 

Info: Reading from c2h channel 0 at address offset 16384.
Info: Wait for the current transactions to complete.
sscanf() = 1, value = 0x00002000
sscanf() = 1, value = 0x00004000
sscanf() = 1, value = 0x00000001
device = /dev/xdma0_c2h_0, address = 0x00004000, size = 0x00002000, offset = 0x00000000, count = 1
host memory buffer = 0x1c62000

 

 

Thank!

0 Kudos
3 Replies
Newbie warmonkey
Newbie
893 Views
Registered: ‎12-25-2017

Re: xilinx answer 65444 - dma_to_device: dma_to_device.c:173: test_dma: Assertion `rc == size' failed

because dma_to_device read data from data/datafile0_4K.bin which is only 4096 bytes

you should use a larger file instead

0 Kudos
Visitor fzhu129
Visitor
748 Views
Registered: ‎02-13-2018

Re: xilinx answer 65444 - dma_to_device: dma_to_device.c:173: test_dma: Assertion `rc == size' failed

Hi eddylee:

 

I did same test as yours but my situation even worse.

 

After run_test.sh runs, it hangs over there.

 

I can not see: CLOCK_MONOTONIC reports 0.000049757 seconds (total) for last transfer of 8192 bytes.

 

Do you have any suggestions?

 

Thanks

Frank

 

 

0 Kudos
Highlighted
Observer athulya
Observer
90 Views
Registered: ‎08-13-2019

Re: xilinx answer 65444 - dma_to_device: dma_to_device.c:173: test_dma: Assertion `rc == size' failed

I get the same error when i do ./dma_to_device from command prompt. I am transfering h2c 10bytes here. But even that gets stuck. C2h is also stuck. Pls suggest!!!

0 Kudos