Adding external Pico WH board to Raspberry Pi 5 via USB

Goal:

-Resolve conflicts with serial port

-Install RP Pico

-Upgrade Firmware of RP Pico

-Get ready to continue on from Nebula Raiders Projects

Prior to Raspberry Pi 5, I had a Raspberry Pi Pico WH board (which I got with Nebula Raiders).  It was connected via USB cable to back of my iMac.  Now that I have a Raspberry Pi 5, I want to add the Pico WH to the Pi 5, and then program it with Thonny.

Installation of Pi Pico WH board, attached to USB port on Raspberry Pi 5

Plug USB cable into Pi Pico WH board

Thonny shows Local Python 3, within Thonny on Pi 5

Plug USB cable into Raspberry Pi 5

Now I have a choice of MicroPython (Raspberry Pi Pico).  That was easy.

Version of Micropython is v1.26.1 on 20250911; Raspberry Pi Pico WH with RP2040

Upgrading Firmware on Pi Pico WH

-Unplug Pi Pico WH USB cable from Pi 5 (Note: When plugged in it was dev/ttyACMO)

-Hold down BOOTSEL button on Pi Pico as you plug USB into Pi5; a folder should open called RPI-RP2.  This is basically looking like it mounted a drive.

-Thonny; at bottom right, click on Local Python 3 (that’s the RP 5)

-Configure Interpreter; Select Micropython (Raspberry Pi Pico)

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

-This is not working.  I also uninstalled Tor, as I started having boot-up issues.  Not sure if correlated.  Note: Likely now that uninstalling Tor was no factor to the resolution.

Troubeshooting this error on start-up, that I think is correlated with the attached Pico WH board:

-After a restart, I was getting: failed to start serial-getty@ttyAMA10.service and had to brute-force turn off.  I also unplugged the RP Pico from RP 5

-One trick was to unplug Ethernet; start up; plug in Ethernet

Boards said: The error failed to start serial-getty@ttyAMA10.service 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.

I’m thinking the Raspberry Pi Pico WH is conflicting.  I’ve now read various boards and AI lookups.  I’m confident I have the answer – needing to stop Getty Serial Port from starting, as it conflicts with how I’m connecting the RP Pico via USB (which is a serial port).  But, it’s wanting multiple steps, which I want to go through carefully before making changes.

Note: At this point, I still haven’t upgraded the Firmware of the RP Pico.

Update: Went through the standard procedure and was able to update the firmware.  Staying connected OK.  Primary issue I have is with something called Plymouth

 

 

 

Posted in Raspberry Pi | Leave a comment

Geany IDE for c Programming on RP 5

Note: Seems like nothing is just a simple install and done.  I’d like to start getting back to learning c programming.  I have various books (K&R; Schildt, etc).  Don’t really need for work, but it’s a good brain exerciser.

On RP5, it comes with Geany, which is recommended for what I’m doing, considering starting with Schildt Books.

Was able to run the first program of hello.c.  That worked.

Wanted to install the Geany GDB Debugger:

Sudo apt update

Sudo apt install geany-plugins

That did a good amount of installation, but not the GDB debugger.  There is a plugin called Debugger, but I don’t think that’s what I want.

I read something about system dependencies: Geany plugins often silent-fail to load if they require an underlying system library that is missing. The debugger plugin specifically relies on the VTE (Virtual Terminal Emulator) library

sudo apt-get update
sudo apt-get install gdb libvte-dev

Checked Geany again for the plugin:

Not there

Installing the base geany package does not automatically install all of its available plugins. You must ensure the plugin bundle or the explicit debugger package is added:

sudo apt-get install geany-plugins geany-plugin-gdb

NOTE: Came back with: geany-plugin-gdb has not installation candidate

Tried this:

sudo apt-get install geany-plugins geany-plugin-debugger

Note: That worked for the CLI (Says that geany-plugin-debugger set to manually installed; already the newest version of 2.0-6+b1)

Resolution, I think.  I went down a rabbit-hole, and then found this:

In many versions of the Geany Plugins Bundle, the classic “Debugger” plugin was replaced or complemented by an upgraded front-end called Scope.

Within Plug-in Manager, I see Scope, and it says it’s a relatively simple GDB front-end.  I selected that.

Well…  I think the debugger is installed.  Just need to figure out how to use it.

 

 

 

 

 

Posted in c Programming | Leave a comment

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
Posted in Raspberry Pi | Leave a comment