cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
r-ziobrowski
Newbie
Newbie
347 Views
Registered: ‎03-06-2021

LwIP TCP transmission fails when AXI DMA is used

Hello,

At the start I want to say that I'm using ZYBO Z7-10 board and I'm working on Vivado 2019.1 version.

I'm working on a kind of camera driver which should take data sent from PC (over Ethernet / TCP) using LwIP, from PS data should be sent to PL using AXI DMA and after that Sequencer located in PL is driving signals to the chip and measurement data from the chip is coming back in the same fashion (i.e. chip -> PL -> AXI DMA -> PS --LwIP--> PC).

While testing this system using loopbacks on PS side and on AXI DMA side I've found out that LwIP transmision from PS to PC fails while AXI DMA is used. When loopback is connected only in PS (so data coming from PC is immediately sent back to the PC over LwIP) the transmission works fine.

What is also strange is fact that method of sending and receiving data on PC side also has an impact on success of transfer. To send the data I'm using Python. At first I was just connecting to the socket, sending data, receiving data and closing socket. When I wanted to send data few times I've added for loop on the whole thing including connection to the socket and closing it. With this configuration it's working fine. Problem is when only sending and receiving data is in the for loop. When that is the case, first transmission is fine, but the second one is failing (tcp_write() is called always 4 times only when it fails and then it stops - transmission is not finished). Data transmission using LwIP is done with callbacks (RAW API - no OS are used).

What could be cause of this issue? I've checked the output of tcp_write() and it shows no errors, in other places like XAxiDma_SimpleTransfer() also no errors are showing. Everything looks intact but somehow program is not going to sent_callback() function after this 4 tcp_write() calls. In terminal you can see that sum of write_length (value from tcp_sndbuf() after each callback) is nowhere near 1 000 000 Bytes that I was sending:

r-ziobrowski_0-1615054699113.png

So not enough data is being sent to PC for some reason.

If you guys have any suggestions what I should change, check, improve, please let me know.

Thanks!

0 Kudos
2 Replies
r-ziobrowski
Newbie
Newbie
330 Views
Registered: ‎03-06-2021

What I've found out right now is that this second transmission eventually finishes but it takes like 15 minutes to do so. I've just let the program running in the background and when I came back I saw that it was finished.

0 Kudos
derekm_
Voyager
Voyager
326 Views
Registered: ‎01-16-2019

I can't help with your problem (I've never seen this issue), but anytime I've used lwip, I find Wireshark to be very helpful. It might point you in the right direction.

0 Kudos