How to stop the serial login console before a Fomu UART test¶
You want the Fomu EVT’s UART test to own /dev/serial0.
The Pi’s login console holds it; the wires are on Fomu EVT wiring to a Raspberry Pi.
What you need¶
A Raspberry Pi with the Fomu EVT on its GPIO header and a GPIO UART at
/dev/serial0.sudorights on the Pi.
Steps¶
On the Pi, stop early if there is no GPIO UART here. Otherwise the lookup in step 2 resolves to nothing, and the mask silently targets the wrong unit.
$ [ -e /dev/serial0 ] || { echo "no GPIO UART on this host"; exit 1; }
In the same shell, resolve
serial0to the real device; this works whether the GPIO UART is the PL011 (ttyAMA0) or the mini UART (ttyS0).
$ GETTY="serial-getty@$(basename "$(readlink -f /dev/serial0)").service"
Mask the unit, which prevents systemd from restarting the serial login console.
$ sudo systemctl mask "$GETTY"
Stop the instance that is running.
$ sudo systemctl stop "$GETTY"
Kill any remaining process holding the port.
$ sudo fuser -k /dev/serial0
Fix the permissions after
serial-gettyreleases the device.
$ sudo chmod 666 /dev/serial0
With the Fomu in its DFU bootloader (
lsusblists1209:5bf0), run the UART test. It loads the UART echo design, then opens/dev/serial0at 115200 baud. It is the check’suarttest, described on the page under Next.
The UART echo design has no USB core, so after the test the Fomu is off USB. The second command puts foboot back for
the next load: it resets the Fomu through the header and waits for 1209:5bf0 on USB.
$ sudo fpgas-fomu-debug test uart
$ sudo fpgas-fomu-debug reset
Check¶
Each command returns without an error.
The UART test reads its echo from the design on
/dev/serial0.After
fpgas-fomu-debug reset,lsusblists1209:5bf0again.
If it fails¶
What you see |
Likely cause |
Fix |
|---|---|---|
|
|
Run the test on a Pi that has the GPIO UART |
The test cannot load the design; |
The Fomu is out of its DFU bootloader |
|
|
The reset through the header did not restart foboot |
Ask the site operator, then power-cycle the Fomu’s host. Then check that |
|
The Pi could not drive the Fomu’s header: the host is not a Raspberry Pi, the header read failed, or a header line was left an output |
Ask the site operator, then power-cycle the Fomu’s host. Then check that |
The test reads nothing, or the output is corrupt |
The login console came back and consumes the serial data: |
Run the block again; the |