Skip to main content

MDIO

Found under IO on the device's panel list.

MDIO Log

Reads and writes registers on an Ethernet PHY over MDIO, or on an SFP module over I2C, using one of four protocols, and logs the results.

The screen

A scrolling log fills the screen, oldest at the top and newest at the bottom. A read, write or modify prints a short group of lines for the raw register transaction, then a summary line with the result; a poll prints one line for each PHY address that answers, plus a separate line for the SFP check.

Controls

ButtonAction
GrayPoll: scan PHY addresses 0-31 and check for an SFP module
Hold GrayClear the log
YellowSet up a register read
GreenSet up a register write
BlueSet up a read-modify-write
AIOpen the Logic Analyzer view
CancelThis help page

Red draws no label on this main view; HOME leaves the screen from here, as it does everywhere else in the menu. Opening a setup list puts a live back arrow on Red - see below.

Pins

MDC, MDIO and the buffer-direction line are fixed at GPIO 25, 26 and 27, reaching the CN26 header - the same GPIO map FreeWili 1 uses for MDIO. They are not configurable from this screen.

Setting up a read, write or read-modify-write

Yellow, Green and Blue each open a list titled "Setup" with its fields shown as Name [value]. Center (or tap) opens the highlighted one:

  • Method - Clause 22, Clause 45, Clause 45 EMU, or Intrepid SFP. Opens its own pick list with the current method highlighted.
  • Phy Addr (0-31) - shown for Clause 22, Clause 45 and Clause 45 EMU.
  • Device Addr (0-31) - shown for Clause 45, Clause 45 EMU and Intrepid SFP.
  • Register Addr - shown for every method; its top end depends on the method, 31 for Clause 22 or 65535 for the others.
  • Data - the value to write; shown on the write and modify lists.
  • Data Mask - which bits of Data replace the register's existing value; shown only on the modify list.
  • Poll Rate (ms) - shown only on the read list. It can be set but currently has no effect - a read still runs once, the same as any other read.

Changing the method changes which address fields are offered, since Clause 22 only needs a PHY address, Intrepid SFP only needs a device address, and Clause 45 (plain or emulated) needs both.

Only two buttons are live on a setup list. Blue is labeled with the operation it runs - Read, Write or Modify - performs it, and returns to the log. Red carries a back-arrow label here instead of its usual blank one, and cancels back to the log without running anything. Gray, Yellow and Green show no label on a setup list.

Reading the log

A successful read, write or modify logs twice. First the raw register access prints as a short group of lines: the operation tag (22 R), 22 W), 45 R), 45 W), 45x R)/45x W) for Clause 45 EMU, or SFP R)/SFP W)), then whichever of the PHY address and device address the method uses, then the register address and the value. Reads log in black and writes log in blue; a modify logs both a read group and a write group, since a read-modify-write is a read followed by a write internally. Second, a purple summary line repeats the result on its own: Read <value>, Wrote <value>, or Now <value> for a modify, each with the four-digit hex value.

If the register access itself fails once MDIO is already set up, a message box reports it directly - MDIO read failed, MDIO write failed or MDIO modify failed - and nothing is added to the log for that attempt. If setting up MDIO fails before the access is even attempted, the message box names what went wrong instead, for example MDIO init: IO expander did not answer or MDIO init: FPGA refused HSBDIO mode.

Poll

Gray sweeps every PHY address from 0 to 31, checking Clause 22, Clause 45 and Clause 45-via-Clause-22 (emulation) compatibility at each one over MDIO, then separately checks for an Intrepid SFP module over I2C. This blocks the firmware for a few seconds while it runs - the screen will not respond until it finishes.

Each address that answers logs a blue line here, PHY found at address <addr>. Compatability: <clauses>. (that is the actual spelling on screen). Addresses that answer nothing are not logged individually; if none of the 32 answer, a single red No MDIO PHYs Found line is added instead. The SFP check logs its own line - blue SFP ID: ... with the module's temperature and signal quality if one is found, or red SFP Module not Found if not - and it always runs, even if the PHY sweep above it stopped early.

If MDIO itself fails to set up partway through the sweep - the same failures a read or write can hit - the sweep stops right there without logging anything for it; that failure only reaches the console, not this screen.

Holding Gray instead of tapping it clears the log without polling.

Logic Analyzer view

AI switches to a Logic Analyzer view of the MDC and MDIO lines, with a title line showing the mode, sample rate and capture state. AI on that view returns here. This tool always carries that view alongside it, so AI always has something to open.

Power

This screen needs the FPGA power zone (6): setting up MDIO drives the FPGA's HSBDIO mode so GP27 can steer the GP26 buffer direction, and that setup needs the FPGA's register bus to answer. Opening this screen switches that rail on if it was off, without asking; setup is unlikely to succeed until it is up. That only happens once, on entry - it does not re-run before a read, write, poll or modify. Zone 6 is on by default and is also switched from Power Devices.

Logic Analyzer

Captures a burst of digital pins over time and draws them as waveforms, so you can see fast signal changes a live view would miss.

The screen

A title line across the top names what this view is doing: the mode it is capturing, the sample rate, and its state - for example "SPI analyzer 1M idle", changing to armed once you start a capture and to done once the capture lands. Once a capture is loaded, the title also adds a position, such as "done 2/4", showing which slice of the buffer the trace below is panned to.

Below the title, each row is one channel: its name on the left, its waveform trace beside it. Which pins appear here, and what they are named, depends on which tool you opened this screen from. Once a capture lands, a red vertical line marks the sample where the trigger fired.

On screens with a long channel list - GPIO in particular - Up and Down move a highlighted row, shown with a gray band behind its name, and whichever channel is highlighted when you arm a capture becomes its trigger source. On screens with only a few channels, there is no highlighted row: Up and Down do nothing here, and the trigger source is always the first channel shown.

The title costs some of the screen's height, so the GPIO capture - the one with the longest channel list, 13 rows - now shows 12 at a time and scrolls with Up and Down to reach the last one. The shorter protocol channel lists still show every row at once.

Controls

ButtonAction
YellowCycle the trigger edge: rising, falling, or none (one-shot)
GreenCycle the capture rate: 10M, 1M, 100k, or 10k samples per second
BlueArm the capture, or stop it while armed
RedForce the trigger while armed
Left / RightPan through a finished capture
Gray / PageBack - returns to the protocol panel this view was opened from
CancelThis help page

Red forces the trigger and keeps its Trig label to say so. Home leaves the app from here the same as it does everywhere else.

Capturing

Blue arms the capture - its label changes from Arm to Stop while armed - and waits for the trigger condition set by Yellow on its trigger source (see The screen above for how that source is chosen): a rising edge, a falling edge, or none, which starts capturing right away without waiting for either. Red forces the trigger early if you do not want to wait for it. Green sets how fast the capture samples, from 10 million samples a second down to 10 thousand; faster rates see less time but finer detail.

Capture depth

The sample buffer behind a capture is a fixed size, so the number of samples it holds depends on how many channels you are watching, not just the rate - fewer channels leaves room for more samples in the same buffer. A faster rate always covers less time, and how much less depends on that channel count.

After a capture

Once a capture lands, the waveform fills the screen with the trigger point placed roughly three-quarters of the way across, so more of what happened before the trigger is visible than after it. Left and Right step the view through the rest of the buffer around it; before a capture finishes, they do nothing.

Shared by several tools

This screen appears inside several different tools - GPIO, I2C, SPI, UART and MDIO all open it with their own Page button, each showing that tool's own pins or bus signals as the channels here. Gray or Page on this screen returns you to whichever one opened it.

The capture itself runs on the RP2350's own PIO hardware, not the FPGA, so opening this screen never needs the FPGA power zone. SPI, UART, GPIO and MDIO route their own header lines through the FPGA and need that zone regardless of this screen; I2C reaches the header directly and needs no FPGA zone at all.

See also: MDIO — the console/GUI commands for this panel.