Target Monitor permission denied - inconsistently

Hi all,

I have installed PlatformIO Core, version 6.1.12.

I have been able to build and upload to my Seeed Xiao RP2040, but it seems every second or third attempt I get the error UserSideException: [Errno 13] could not open port /dev/ttyACM0: [Errno 13] Permission denied: '/dev/ttyACM0'.

I am on Arch. I am a member of the lock, uucp, users and wheel groups (as well as several others).

My serial port is ``ls -aslF /dev/ttyACM0
0 crw-rw-rw-+ 1 root users 166, 0 Jan 11 20:16 /dev/ttyACM0`

So I assume I have installed the udevadm rules correctly, and I have rebooted.

What confuses me is that if I run pio --target monitor immediately after pio --target upload --target monitor I can interact with the serial port.

I’d like to try adding a delay at the end of build, say, 2 seconds to see if that helps while USB devices settle, but I’m not sure how, or if this is even the right approach. Any assistant would be greatly appreciated.

Thanks in advance!

EDIT: I also checked my /etc/udev/rules.d directory in case there was an additional file or rules causing problems, there is only one other file for a Digilent device, and it has an unrelated ATTR{idVendor}=="0403" condition in there, so it shouldn’t be interacting with this.

EDIT2: I have also run a grep in /usr/lib/udev/rules.d/* for anything with 2e8a in it, but nothing came up.