Practical 2 - Advanced Software

Note: Only half of the hardware lab is wired up to our network. The computers at the far end of the lab have green Ethernet cables on the desk. Connect these cables to the FPGA board, and to the on-desk Ethernet jack (numbered CSE/X/XXX-XX) that doesn't have a green sticker on it. The FPGAs on the VLAB are connected to our network.

The purpose of this practical is to develop a larger application using the ARM and the Ethernet. The application you will develop is an Ethernet-based text chat program. You should be able to use the UART to send messages to other students and to read any messages sent to you.

You will need to refer to the Software API page for a description of how to access the Ethernet, and send and receive packets.

Create a new blank application project (use the Blank Project template), then follow the instructions in the Ethernet section on the Software API page for adding the lwIP library and code.

Each student is assigned a unique MAC address and your solution should set its MAC address accordingly.

Your assigned MAC address and other network information can be found on the EMBS Student Network page.

Try not to accidentally MAC-spoof your fellow students or anything else on the network! Always double-check your source and destination MACs are in the right places, and don't echo back packets without changing these, as the network switches will not like this.

Your application should use DHCP to get an IP address. These will be in the range 192.168.10.1XX where XX is the last two characters of your MAC (not the last numerical byte). For example, if your MAC is 00:11:22:33:00:42 your assigned IP will be 192.168.10.142 (as shown in the address table).

An interaction with your application will look like this:

  • The user enters the last octet of the target IP address and presses Enter.

  • The user types a message and presses Enter.

  • The application sends the message to the specified target using port 51000. The message appears on the UART output of the target board. 

  • Your solution should queue up all received messages in some data structure while the user is typing, then once the user has finished and sent their message your system should display in order all the queued messages. Note that if you just "don't call handle_ethernet()“ then some amount of internal buffering will happen in the lwIP library, but for the purpose of this exercise don't rely on this.

You should be able to communicate with each other, but there is also a server on the network sending periodic broadcast messages (cat facts) from the IP address 192.168.10.1.

The server that you are talking to is 192.168.10.1 and is listening and sending on UDP port 51000

If you send a message to this server, it will respond to you with a copy of the message you sent (unless you send "STOP"). This is useful for testing.

 

Once you have completed this task, show Ian.