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 black 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 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 (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. The message appears on the UART output of the target board. 

Remember the discussion of Cyclic Executives from EMBS part 1. 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.

Ethernet networks are noisy, and many packets that are not related to EMBS may be observed. As a result, you should communicate on UDP port 51000.

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

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

Once you have completed this task, show a demonstrator who will test your program and sign it off in your logbook.

  • No labels