I highly doubt that an RP2040 could ever have been power cycled or reset without the host noticing an issue on the USB. And that the 2040 would then somehow remember that in a previous life it had been configured for serial communications, so now it can avoid all the normal setup and host interaction and memory allocation involved in that. And just magically carry on working where it left off.My interpretation was that previously a momentary interruption like a quick replug powercycle or use of RST button, was not long enough for the OS to see it as a connection drop-out and remove the device. That same device was still active and picked up the new data stream.
Have you checked my idea that some Linux process may be holding the device file open and preventing its reuse? Just before the reset, sudo fuser /dev/ttyACM0 should tell you which process IDs have it open. These are the ones that either need to close it very promptly, or be prepared to use the correct device next time.
Does it help if you keep the device in reset for several seconds?
Statistics: Posted by jojopi — Tue Aug 20, 2024 5:14 pm