Debian Trixie on Framework 13 with AMD Ryzen AI 5 300 series

This topic describes my 1-month experience with Framework 13 running Debian Trixie Linux.

Framework 13 laptop

I bought Framework 13 with an AMD Ryzen AI 5 340 CPU, 64 GB of memory, and 1 TB of SSD (all components purchased from the Framework e-shop).

Stability tweaks

I’m running Debian Trixie with the stable Linux Kernel (6.12.57+deb13-amd64 at the time of writing). It works very reliably with the Framework 13 laptop. All stability issues concern waking from suspend.

Wireless device

The wireless driver gets stuck after a few suspends. The solution to this issue is simple and uses D-Bus to unload the driver before suspend and load the driver after waking up:

# First, create a script that unloads and loads the driver
sudo systemctl edit --force --full mt7925e-suspend
# Paste the following content
[Unit]
Description=Unload mt7925e driver before suspend
Before=sleep.target
StopWhenUnneeded=yes

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/sbin/modprobe -r mt7925e
ExecStop=/sbin/modprobe mt7925e

[Install]
WantedBy=sleep.target
# Start and Enable the script
sudo systemctl enable mt7925e-suspend
sudo systemctl start mt7925e-suspend

Note: The issue is supposed to be solved in kernel 3.16 or newer. I stayed with the LTS kernel provided by Debian, though. The main reason is the stability and security of my machine, since I use it mainly for work.

Fingerprint reader

The issue with the fingerprint reader was much harder to resolve because the main problem was that the fingerprint device got stuck at the hardware level, and reloading drivers wouldn’t help.

I have unsuccessfully tried the following tweaks:

  • Adding usbcore.autosuspend=-1 to the kernel parameters
  • Adding xhci_hcd.quirks to the kernel parameters (no combination of 0x2708 did make a difference)

I ended up solving the issue by switching the USB BUS power on and off. First, you have to find the fingerprint device USB ID:

lsusb | grep Fingerprint

To identify the USB bus ID for the fingerprint sensor, turn off the USB power. When the fingerprint reader stops being recognized, you have found the correct bus ID:

# Printout your USB busses
lspci -nnk | grep -i xhci_pci -B3
# Switch off the power
echo "0000:${BUS_ID}" | sudo tee /sys/bus/pci/drivers/xhci_hcd/unbind
sleep 1
echo 1 | sudo tee "/sys/bus/pci/devices/0000:${BUS_ID}/reset"
# Switch the power back on
echo "0000:${BUS_ID}" | sudo tee /sys/bus/pci/drivers/xhci_hcd/bind

When you find the USB bus ID, write down a script that turns the USB bus power on and off:

#!/bin/bash
if [ "$1" = "start" ]; then
  exit
fi
FINGERPRINT_READER_ID="<your fingerprint USB device ID>"
BUS_ID="0000:${BUS_ID}"
if ! lsusb | grep "$FINGERPRINT_READER_ID" > /dev/null ; then
  sleep 1
  echo "$BUS_ID" | sudo tee /sys/bus/pci/drivers/xhci_hcd/unbind
  sleep 1
  echo 1 | sudo tee "/sys/bus/pci/devices/$BUS_ID/reset"
  sleep 1
  echo "$BUS_ID" | sudo tee /sys/bus/pci/drivers/xhci_hcd/bind
fi

Create a D-Bus service that will automatically run the script after each wakeup (similar to the wireless device fix) sudo systemctl edit --force --full fingerprint-fix:

[Unit]
Description=Check and reset fingerprint reader after wake up
Before=sleep.target
StopWhenUnneeded=yes
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=<path to your script> "start"
ExecStop=<path to your script> "stop"
[Install]
WantedBy=sleep.target

Enable and start the service:

sudo systemctl enable fingerprint-fix
sudo systemctl start fingerprint-fix

Other useful tweaks

After a couple of weeks of use, a couple of things became annoying, so here is the list of them and how I fixed them.

Disable the fingerprint reader when the lid is closed

I often use an ultrawide screen with my laptop lid closed. In this situation, it’s beneficial to disable the fingerprint prompt (for both login and sudo).

  • First, you need the acpid package - sudo apt install acpid.
  • sudo vim /etc/acpi/lid.sh:
#!/bin/bash
grep -q close /proc/acpi/button/lid/*/state
if [ $? = 0 ]; then
    # Lid is closed - disable fingerprint
    systemctl stop fprintd
    systemctl mask fprintd
else
    # Lid is open - enable fingerprint
    systemctl unmask fprintd
    systemctl start fprintd
fi
  • sudo chmod +x /etc/acpi/lid.sh
  • sudo vim /etc/acpi/events/lid:
event=button/lid.*
action=/etc/acpi/lid.sh
  • sudo systemctl enable acpid
  • sudo systemctl restart acpid

Power consumption on the battery

I can recommend the TLP as it works great out of the box (no need for extra tweaks):

  • sudo apt install tlp
  • sudo systemctl enable tlp
  • sudo systemctl start tlp

Note: To extend your battery’s lifespan, configure the maximum charging level to 80% in the BIOS. Typically, I get over 5 hours of use during regular tasks, starting at 80% and decreasing to about 20% after five hours.

2 Likes