Beginner / 45 min

A small network on one board

What does it actually take to send a ping? Usually, we type a command, watch a few lines appear, and move on. There's quite a bit happening underneath, though, and RPGA Feather gives us a way to try a small piece of it ourselves.

For this project, the RP2040 will send messages and the FPGA will answer them. Both devices are already on the board. We don't need a router, an Ethernet cable, or a second development board to see the exchange happen.

We'll use RPGA_python_net, a project that pairs CircuitPython with a small Ethernet implementation in the FPGA. Is it going to replace your network adapter? No, but it gives us something useful to learn from: messages we can build, send, inspect, and change.

Who does what?

RPGA Feather pairs an RP2040 microcontroller with an iCE5LP4K FPGA. CircuitPython runs on the RP2040. The FPGA gets a hardware design that recognizes a few kinds of network messages and builds replies.

The RP2040 has programmable I/O, usually shortened to PIO. Think of it as a small helper that can move signals through pins while Python handles the larger job. Here, it sends and receives a stream of bits between the two chips.

CircuitPython on the RP2040
          |
   Board's shared signal connections
          |
Ethernet logic in the FPGA

The messages use Ethernet framing, but they travel over this project's clocked board connection. There's no cable-facing Ethernet interface here, and the board won't appear on your home network. The ping comes from the Python program on the RP2040.

Two questions for the FPGA

Our first message uses ARP, the Address Resolution Protocol. That's a long name for a fairly simple question: "Who has this IP address, and what hardware address should I use to reach them?"

An IP address identifies a device within an IP network. A MAC address identifies an Ethernet endpoint. For this example, the two sides have fixed addresses:

These are settings inside the project. You don't need to change your computer's network settings to match them.

Once the FPGA answers the address question, Python sends an ICMP echo request. This is the message behind the familiar ping command. It carries a small piece of data, and the FPGA sends that data back in an echo reply.

That's our goal: ask for an address, send a message, and recognize the answer.

What you'll need

You can follow the ideas without knowing Verilog, the language used for this FPGA design. We'll build the existing design first and keep our first changes on the Python side. If editing code.py is new to you, the first programming guide introduces that workflow.

Continue: Send your first ping.