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.
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 192.168.10.1
.
Finally, if you send a message to the 192.168.10.1
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.