theUltimateSource
Junior Member level 1
hello,
I am working on a Zynq SoC from Xilinx (FPGA + A7) and want to transfer images to the PC.
xapp1026 provides a reference design for an http webserver using lwIP, as a bare metal application. After some modifications I am now able to send and receive simple HTTP POST messages to control my zynq board from the PC via 1GbE using the MAC on the ARM. I am also able to transfer images from my board to the PC.
I'd like to ask for some advice for some modifications on my current work:
The size of my ethernet frame buffer is 1kB. To overcome this limitation I am pointing to the image frame buffer, instead.
Since lwIP is taking care of packet splitting to meet MTU I am assuming that I can provide any number of bytes to be send using tcp_write().
The messages need to be stored in a buffer befor send over lwIP. Since I already have a tripple frame buffer for my video stream, it certainly would be conveniant to point to that data directly instead of copying it to another location. Therefore I generated the HTTP message header imediately before the video frame buffer. I found that I cannot send the entire image frame with a single tcp_write(). When I send it with multiple calls I need to generate the header every time, which is overriding the pixel data in my buffer. This is not a problem for me, but I wonder if I should rather use a seperate DMA, instead.
I'd appreciate any comment, advice or reference,
thank you
I am working on a Zynq SoC from Xilinx (FPGA + A7) and want to transfer images to the PC.
xapp1026 provides a reference design for an http webserver using lwIP, as a bare metal application. After some modifications I am now able to send and receive simple HTTP POST messages to control my zynq board from the PC via 1GbE using the MAC on the ARM. I am also able to transfer images from my board to the PC.
I'd like to ask for some advice for some modifications on my current work:
The size of my ethernet frame buffer is 1kB. To overcome this limitation I am pointing to the image frame buffer, instead.
Since lwIP is taking care of packet splitting to meet MTU I am assuming that I can provide any number of bytes to be send using tcp_write().
The messages need to be stored in a buffer befor send over lwIP. Since I already have a tripple frame buffer for my video stream, it certainly would be conveniant to point to that data directly instead of copying it to another location. Therefore I generated the HTTP message header imediately before the video frame buffer. I found that I cannot send the entire image frame with a single tcp_write(). When I send it with multiple calls I need to generate the header every time, which is overriding the pixel data in my buffer. This is not a problem for me, but I wonder if I should rather use a seperate DMA, instead.
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 // create a HTTP header POST message, store in memory right before frame len = generate_http_header((char *)(frameBufferStartAddress-headerLength), "js", length); // update length of payload, in bytes len += framelength; // create TCP packets from bytes in memory if (tcp_write(pcb, (char *)(frameBufferStartAddress-headerLength), len, 1) != ERR_OK) { printf("error writing http POST response to socket\n\r"); printf("http header = %s\r\n", buf); return -1; }
I'd appreciate any comment, advice or reference,
thank you