Troubleshooting serial port issue – RP Pico to RP 5

Raspberry Pi 5 with USB ports

Raspberry Pi Pico WH with a micro USB Cable to USB

Goal: Connect the RP Pico to the RP 5, in order to then use Thonny IDE on RP5 for programming.  Also, update the firmware of the RP Pico

Issue: When I connect the RP Pico, I get conflict errors, to the point where I cannot restart the RP 5.  I thought it was a corrupt SD card, or recent Tor installation, but the troubleshooting boards all point to a serial port conflict.

Error I saw: Failed to start serial-getty@ttyAMA10.service.  NOTE: Typically happens on the Raspberry Pi 5 when systemd tries to launch a login console (getty) on the dedicated 3-pin debug UART port (ttyAMA10), but the port is either disabled, being blocked by another process, or the kernel serial console argument has been modified or removed from your boot configuration.

Background:

-Getty  is the Linux background service that manages terminal login lines

-When I hook up Pico WH to the Raspberry Pi’s GPIO UART pins (GPIO 14 and 15) to transfer data or execute code, getty will aggressively hijack the port.  In my case I’m not specifically thinking of using UART pins, but there is still a conflict

-When I had initially plugged in the RP Pico and worked in Thonny, I saw this:

-Configure Interpreter; Select Micropython (Raspberry Pi Pico)

-Port selected was n/a @ /dev/ttyAMA10

-This confirms that the RP Pico was using the same port as Getty

Proposed solution, according to troubleshooting boards:

To resolve this conflict and free up the serial port entirely for Pico WH, you must disable both the serial boot console and the getty service

Initial confirmation steps:

-Check what is currently connected to ttyAMA10, in terminal:

sudo fuser -v /dev/ttyAMA10

It came back with a reference to Getty

Turning off ttyAMA10 from Getty accessing:

Step 1: Use raspi-config to Free the Port
The easiest first step is to tell the operating system to stop using the serial port as a console.
sudo raspi-config
  • Navigate to Interface Options (or Advanced Options in older versions) → Serial Port.
  • When asked: “Would you like a login shell to be accessible over serial?”, select No.
  • When asked: “Would you like the serial port hardware to be enabled?”, select Yes.
  • Finish and exit, but do not reboot just yet.
Step 2:
Stop and Mask the getty Service
On newer versions of Raspberry Pi OS (such as Bookworm), getty can sometimes still stubbornly cling to the hardware interface despite using raspi-config. You need to manually terminate and mask the systemd service to make sure it never starts again.
sudo fuser -v /dev/ttyAMA10
Note: Looks like it’s still running, as it referenced agetty
Mask the service (If you aren’t using the 3-pin debug port) – I don’t think I am.
If you don’t need a login terminal via the hardware debug connector, the cleanest solution is to completely mask the service so systemd stops trying to launch it. Run the following commands in your terminal:
sudo systemctl stop serial-getty@ttyAMA10.service
Note: It came back with failed to stop, as was not loaded
sudo systemctl mask serial-getty@ttyAMA10.service
Note: Came back saying service not loaded, but proceeding anyway.  Referenced creating a symlink in /etc/systemd/…
Restarted Pi5
NOTE: The RP Pico wasn’t connected and I left disconnected for the restart
Hmn…   A bunch of things failed to start and flashing cursor and blank screen.
Something about failing to start Network Manager; cloud-config-services; cloud-final-servces; rpc-statd-notify.service
Powered off button and back on
Same thing
Disconnected Cat-5 and restarted
Errors:
Pulled out power and back in; CAT-5 still out
Same issue
Pulled out power and monitor cable
Kept Cat-5 out
Plugged both back in; on
Less errors, but says plymouth-quit.service
WTF!  I plugged the CAT-5 back in and plugged power back in again and it came back to desktop OK.
Ran the sudo fuser command (above), again and getty not loaded
At this point, system is running, but unsure if stable or not
Got it working and able to go into Thonny and update firmware of RP Pico to version 1.28.0
Still not quite convinced the system is stable if I restart it, though
This entry was posted in Raspberry Pi. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.