How to free a NeTV2’s serial port before a test

You want to run a test that reads a NeTV2 design’s output on the Pi’s GPIO UART.

The login console holds that port open and eats or corrupts the design’s output. The device for each Pi model is in Serial device by Raspberry Pi model.

What you need

Steps

  1. On the Pi, run sudo systemctl stop 'serial-getty@*' to stop the serial login console.

  2. On a Raspberry Pi 5, run pinctrl set 14 a4; pinctrl set 15 a4 to restore the UART function of GPIO14 and GPIO15, which is ALT4 (TXD0/RXD0).

  3. On the Pi, run the UART test on your Pi model’s device, from UART test parameters. It loads the UART design over JTAG first. /dev/ttyAMA0 is the default:

    $ sudo fpgas-netv2-debug --port /dev/ttyAMA0 test uart
    

Check

The test reads the design’s output and ends without an error. What a correct run prints is waiting for a run: test-designs issue #249.

If it fails

What you see

Likely cause

Fix

The design’s output is missing or corrupt

The login console still holds the port

Run step 1 again

The output is still corrupt on the maker’s stock NeTV2 image

A netv2-status.js monitor under pm2 also holds the port

pm2 stop all, then pkill -f netv2-status

On a Raspberry Pi 5 the port is silent after step 1

Stopping the console drops the pin mux, so GPIO14 and GPIO15 are plain GPIO

Run step 2

The test cannot open /dev/ttyAMA0 on a Raspberry Pi 3 with Bluetooth enabled

The GPIO UART there is the mini UART at /dev/ttyS0

Change the test’s --port to /dev/ttyS0

Next