Issue with Serial Output on Arduino Portenta X8 (M4) in Arduino Cloud Editor

Hi Arduino Team,

I'm currently working with the Arduino Portenta X8 and trying to establish UART communication using the Arduino Cloud Editor. I'm uploading the following sketch to the M4 core:

#include <SerialRPC.h>  // For Linux communication
#include <Arduino.h>    // For USB debug

void setup() {
  Serial.begin(115200);   // USB debug (Arduino Serial Monitor)
  SerialRPC.begin(115200); // Linux communication
  
  while(!Serial); // Wait for USB connection
  Serial.println("M4 Debug: Ready");
}

void loop() {
  // Your M4 code here
  Serial.println("Debug message to Arduino IDE");
  delay(1000);
}

However, I’m not seeing any output in the Serial Monitor, even though I have selected the M4 core and set the correct baud rate (115200). I’ve also attached a screenshot showing the Serial Monitor view.

Could you please help me troubleshoot this issue? Is there anything specific I need to configure to get USB debug messages from the M4 core when using the Arduino Cloud Editor?

Thanks in advance!

Best regards,
PSR

Try pressing reset on the board

Hi @sridhar_p0266 I suspect, since it uses the same MCU as the GIGA, the X8 does not support Serial from the M4 unless done using RPC
https://docs.arduino.cc/tutorials/giga-r1-wifi/giga-dual-core

Dear Arduino team,

Please react to clear the issue.

Advance Thanks,
PSR

I could see an attempt at code tags but it did not quite work out.

Code tags for a block of code are 3 back ticks (```) before and after the code; they need to be on their own line.

I've fixed it for you.

Hi @sridhar_p0266.

This is expected, as documented here:

https://docs.arduino.cc/tutorials/portenta-x8/python-arduino-data-exchange/#debugging-the-arduino-sketch

To check if the Arduino sketch is working correctly, you may want to read the messages from the Serial.println statements. You cannot currently read them directly in the serial monitor of the Arduino IDE.

(the statement applies equally to the Arduino Cloud Serial Monitor)

You must implement the communication through the board's USB CDC serial port to your PC in the Linux machine of the Portenta X8. An easy way to do that is running a Python script on the Linux machine.

You can send data from the Arduino sketch program running on the M4 core to the Linux machine via the RPC interface:

https://docs.arduino.cc/tutorials/portenta-x8/python-arduino-data-exchange/

The Python script on the Linux machine can pass data received from the Arduino sketch program on to the PC via the serial port.

This Link also i tried, but unable to get the sensor data, and i was uploaded the arduino code from the link, unable to saw the serial.println logs.
can we discuss through google meet.

We prefer to discuss things here on Arduino Forum. That way the knowledge that is shared can benefit the entire Arduino community for years to come. When you use Google Meet, the knowledge shared is only available to the participants, and even they are likely to quickly forget it.

3 posts were merged into an existing topic: Communication Between Linux and Arduino

@sridhar_p0266 has an existing topic on that subject:

Please use the other topic for all further discussion of difficulties with the "04. Data Exchange Between Python® on Linux & Arduino Sketch tutorial.

@sridhar_p0266 in the future, don't allow your topics to converge into parallel discussions as happened here. The reason is that generating multiple forum topics on the same subject matter can waste the time of the people trying to help. Someone might spend a lot of time investigating and writing a detailed answer on one topic, without knowing that someone else already did the same in the other topic.