Whitney Knitter
Published © GPL3+

Getting Started with lwIP on the SP701

See how to setup a Vitis software platform to utilize the lightweight IP (lwIP) stack for the Spartan-7 SP701 FPGA development board.

IntermediateFull instructions provided1 hour3,477
Getting Started with lwIP on the SP701

Things used in this project

Story

Read more

Schematics

UG1319 SP701 Evaluation Board User Guide

Code

echo_client.py

Python
import socket
import sys

print('Create a socket on the host PC client.')
lwIP_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

print('Connect to the socket of the lwIP server listening on the SP701.')
lwIP_server_address = ('192.168.1.10', 7)
lwIP_socket.connect(lwIP_server_address)

try:
	message = 'Hello lwIP on the SP701!'
	message_byte = message.encode()
	
	lwIP_socket.sendall(message_byte)
	
	bytes_buffer_size = 32	
	bytes_received = 0
	bytes_total = len(message)
	
	while bytes_received < bytes_total:
		message_recvd = lwIP_socket.recv(bytes_buffer_size)
		bytes_received += len(message_recvd)
		print(message_recvd)
		
finally: 
	print('Closing the socket from the host PC client side...')
	lwIP_socket.close()

Credits

Whitney Knitter

Whitney Knitter

169 projects • 1699 followers
All thoughts/opinions are my own and do not reflect those of any company/entity I currently/previously associate with.

Comments