"Disconnected from Serial Port" while running Hello World on M5Stack (UIFlow2, Ubuntu)
-
Issue Summary
I'm trying to run a simple "Hello World" program on my M5Stack Core using UIFlow2 on Ubuntu 22.04, but I keep experiencing an issue where the serial connection drops unexpectedly. Here’s what happens when clicking Run or Download the program to the device: a pop up appears, the device connects successfully and logs RAM information:
heap RAM free: 55760 heap RAM alloc: 45296 heap RAM free: 55760 heap RAM alloc: 45296 ...
After a few seconds, I get
"Disconnected from Serial Port"
, and the device is no longer accessible.My device shows Public, the device mac, the associated user account, a QR Code ...
What I've Tried So Far
- Checked USB connection
- Used a high-quality data USB cable.
- Switched between USB 2.0 and USB 3.0 ports.
- Tried a different cable and another PC.
- Verified Serial Port availability
After disconnection, I ran
ls /dev/ttyACM*
Before and After disconnection:
/dev/ttyACM0
is listed. I can't see if it disconnects when I upload the code- Disabled ModemManager (Ubuntu)
sudo systemctl stop ModemManager
- Flashed the latest UIFlow2 firmware using M5Burner
- Used M5Burner to install the latest version of UIFlow2.
- Issue persists even after flashing and rebooting.
- Tried a minimal script in UIFlow2
from m5stack import * from m5ui import * from uiflow import * lcd.clear() lcd.print("Hello World", 10, 10)
The screen does not display "Hello World" before disconnection occurs.
Questions
- Why does my M5Stack disconnect from the serial port after a few seconds?
- Is this a firmware issue or a hardware problem?
- Could this be related to power management settings or a driver issue on Linux?
Any help would be greatly appreciated! Thanks in advance. 😊