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: 
Highlighted
Participant ucabsdp
Participant
3,833 Views
Registered: ‎07-06-2013

LwIP ethernet sending numerical data

Jump to solution

Hi,

 

I am trying to send numerical data(large matrices) via ethernet to a  Zynq7020. I have looked at the LwIP Echo Server demo and tried to implement a method to read the payload into a float. For now I want to use TCP, although I guess UDP maybe more efficent for data transfers.

 

What is the best way to convert the p->payload into a float. I have tried casting to char *, using unions, but I keep getting nonsensical results. 

And on the client side what is the best way to send a float via TCP socket? As at the moment i am again trying to cast to char * and then send that buffer.

 

Many thanks

Sam

0 Kudos
1 Solution

Accepted Solutions
Participant ucabsdp
Participant
4,977 Views
Registered: ‎07-06-2013

Re: LwIP ethernet sending numerical data

Jump to solution
0 Kudos
2 Replies
Participant ucabsdp
Participant
4,978 Views
Registered: ‎07-06-2013

Re: LwIP ethernet sending numerical data

Jump to solution
0 Kudos
Observer chadigo
Observer
3,403 Views
Registered: ‎05-18-2009

Re: LwIP ethernet sending numerical data

Jump to solution

I ran into a similar sounding problem recently.  I am running the lwip echo server on a VC707 using Microblaze.  I made some edits to transfer and parse unsigned words to and from the eval board.

 

I casted the pointer to the payload as a uint32 pointer, and found that the word being read didn't make sense.  For example, if in memory the pointer was pointing to 0x00000006 (in memory 00 00 00 06 00 00 FF FF, pointer location in bold) it would read it as 0x00060000. 

 

While debugging I noticed that the payload was pointing to address 0xc00b0176, which isn't word aligned. The process reads out 0x00060000(code:  Command = DataArrayIn[0]; where DataArrayIn is pointing to the address of the payload).  Which seems to me like the compiler/processor is reading from the wrong address, presumably 0xc00b0174.

 

I have a temporary workaround where I memcpy the payload to a word aligned memory location.

0 Kudos