🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Serial not working with M5Unified on AtomS3

    Arduino
    2
    3
    2.8k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      frameworklabs
      last edited by

      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

      teastainT 1 Reply Last reply Reply Quote 0
      • teastainT
        teastain @frameworklabs
        last edited by teastain

        @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

        Cheers, Terry!

        100% M5Stack addict with several drawers full of product!

        F 1 Reply Last reply Reply Quote 1
        • F
          frameworklabs @teastain
          last edited by

          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

          1 Reply Last reply Reply Quote 1
          • First post
            Last post