Serial not working with M5Unified on AtomS3



  • Hi,

    I am using M5Unified on my AtomS3 but can't get Serial.println("hello") to show up on the host. I configured the baud rate correctly and things worked on a previous project without M5Unified on an AtomLite. I guess I am missing something obvious here.

    Any help welcomed.

    Marc



  • @frameworklabs This worked for me with my cute AtomS3!

    #include <M5Unified.h>
    
    void setup() {
      M5.begin();
      Serial.begin(115200);
      M5.Lcd.fillScreen(BLACK);
      delay(100);
    }
    
    void loop() {
      Serial.println("loop");
      M5.update();
      M5.Lcd.setTextColor(RED);
      M5.Lcd.setTextSize(2);
      M5.Lcd.setCursor(25, 15);
      M5.Lcd.print("RED");
      M5.Lcd.setTextColor(BLUE);
      M5.Lcd.setTextSize(2);
      M5.Lcd.setCursor(18, 50);
      M5.Lcd.print("BLUE");
      M5.Lcd.setTextColor(GREEN);
      M5.Lcd.setTextSize(2);
      M5.Lcd.setCursor(15, 90);
      M5.Lcd.print("GREEN");
      delay(100);
    }
    

    But with Tools setting: USB CDC on Boot 'enabled'
    -Terry



  • Thanks @teastain for the hint with USB CDC on Boot!

    I forgot to mention that I am on PlatformIO but the snippet shown below added to the platform.ini file helped me to solve the problem. Previously I didn't had to specify any build_flags to see the Serial output, so maybe this is a change introduced by PlatformIO.

    monitor_speed = 115200
    build_flags = 
    	-D ARDUINO_USB_MODE=1
    	-D ARDUINO_USB_CDC_ON_BOOT=1
    

    Best
    Marc