arduino/arduino-examples

Sketches with `Serial.begin()` will not compile unmodified for `arduino:mbed_portenta:portenta_x8`

aliphys opened this issue · 1 comments

Describe the problem

Sketches involving the Serial.begin() will not compile, without adding #include "SerialRPC.h" at beginning of sketch. It will compile when #include "SerialRPC.h is added to the beginning of the sketch

To reproduce

From root of repository run

cd .\examples\01.Basics\AnalogReadSerial\
arduino-cli compile -b arduino:mbed_portenta:portenta_x8 -v
Output

PS C:\GitHub\Arduino\arduino-examples> cd .\examples\01.Basics\AnalogReadSerial\
PS C:\GitHub\Arduino\arduino-examples\examples\01.Basics\AnalogReadSerial> arduino-cli version
arduino-cli  Version: 1.0.0-rc.1 Commit: ba19a2d3 Date: 2024-05-20T08:22:20Z
PS C:\GitHub\Arduino\arduino-examples\examples\01.Basics\AnalogReadSerial> arduino-cli compile -b arduino:mbed_portenta:portenta_x8 -v

FQBN: arduino:mbed_portenta:portenta_x8
Using board 'portenta_x8' from platform in folder: C:\Users\Ali Jahangiri\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.3
Using core 'arduino' from platform in folder: C:\Users\Ali Jahangiri\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.3

Detecting libraries used...
C:\Users\Ali Jahangiri\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4/bin/arm-none-eabi-g++ -c -w -g3 -nostdlib @C:\Users\Ali Jahangiri\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.3\variants\PORTENTA_X8/defines.txt @C:\Users\Ali Jahangiri\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.3\variants\PORTENTA_X8/cxxflags.txt -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -w -x c++ -E -CC -DARDUINO=10607 -DARDUINO_PORTENTA_X8 -DARDUINO_ARCH_MBED_PORTENTA -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=1 -IC:\Users\Ali Jahangiri\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.3\cores\arduino -IC:\Users\Ali Jahangiri\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.3\variants\PORTENTA_X8 -DCM4_BINARY_START=0x08100000 -DCM4_BINARY_END=0x08200000 -IC:\Users\Ali Jahangiri\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.3\cores\arduino/api/deprecated -IC:\Users\Ali Jahangiri\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.3\cores\arduino/api/deprecated-avr-comp -iprefixC:\Users\Ali Jahangiri\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.3\cores\arduino @C:\Users\Ali Jahangiri\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.3\variants\PORTENTA_X8/includes.txt C:\Users\Ali Jahangiri\AppData\Local\Temp\arduino\sketches\056DCEC076E532137E9F3A17145D1D1C\sketch\AnalogReadSerial.ino.cpp -o nul
Generating function prototypes...
C:\Users\Ali Jahangiri\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4/bin/arm-none-eabi-g++ -c -w -g3 -nostdlib @C:\Users\Ali Jahangiri\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.3\variants\PORTENTA_X8/defines.txt @C:\Users\Ali Jahangiri\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.3\variants\PORTENTA_X8/cxxflags.txt -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -w -x c++ -E -CC -DARDUINO=10607 -DARDUINO_PORTENTA_X8 -DARDUINO_ARCH_MBED_PORTENTA -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=1 -IC:\Users\Ali Jahangiri\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.3\cores\arduino -IC:\Users\Ali Jahangiri\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.3\variants\PORTENTA_X8 -DCM4_BINARY_START=0x08100000 -DCM4_BINARY_END=0x08200000 -IC:\Users\Ali Jahangiri\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.3\cores\arduino/api/deprecated -IC:\Users\Ali Jahangiri\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.3\cores\arduino/api/deprecated-avr-comp -iprefixC:\Users\Ali Jahangiri\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.3\cores\arduino @C:\Users\Ali Jahangiri\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.3\variants\PORTENTA_X8/includes.txt C:\Users\Ali Jahangiri\AppData\Local\Temp\arduino\sketches\056DCEC076E532137E9F3A17145D1D1C\sketch\AnalogReadSerial.ino.cpp -o C:\Users\Ali Jahangiri\AppData\Local\Temp\1542543350\sketch_merged.cpp
C:\Users\Ali Jahangiri\AppData\Local\Arduino15\packages\builtin\tools\ctags\5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives C:\Users\Ali Jahangiri\AppData\Local\Temp\1542543350\sketch_merged.cpp
Compiling sketch...
"C:\\Users\\Ali Jahangiri\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" -c -w -g3 -nostdlib "@C:\\Users\\Ali Jahangiri\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_portenta\\4.1.3\\variants\\PORTENTA_X8/defines.txt" "@C:\\Users\\Ali Jahangiri\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_portenta\\4.1.3\\variants\\PORTENTA_X8/cxxflags.txt" -MMD -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -DARDUINO=10607 -DARDUINO_PORTENTA_X8 -DARDUINO_ARCH_MBED_PORTENTA -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=0 "-IC:\\Users\\Ali Jahangiri\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_portenta\\4.1.3\\cores\\arduino" "-IC:\\Users\\Ali Jahangiri\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_portenta\\4.1.3\\variants\\PORTENTA_X8" -DCM4_BINARY_START=0x08100000 -DCM4_BINARY_END=0x08200000 "-IC:\\Users\\Ali Jahangiri\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_portenta\\4.1.3\\cores\\arduino/api/deprecated" "-IC:\\Users\\Ali Jahangiri\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\mbed_portenta\\4.1.\Ali Jahangiri\\AppData\\Local\\Temp\\arduino\\sketches\\056DCEC076E532137E9F3A17145D1D1C\\sketch\\AnalogReadSerial.ino.cpp.o"
C:\GitHub\Arduino\arduino-examples\examples\01.Basics\AnalogReadSerial\AnalogReadSerial.ino: In function 'void setup()':
C:\GitHub\Arduino\arduino-examples\examples\01.Basics\AnalogReadSerial\AnalogReadSerial.ino:16:15: error: call to 'ErrorSerialClass::begin' declared with attribute error:

****
Please include SerialRPC library to use Serial
****


   Serial.begin(9600);


Used platform         Version Path
arduino:mbed_portenta 4.1.3   C:\Users\Ali Jahangiri\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.3
Error during build: exit status 1

Expected behavior

In the Out of Box (OoB) experience for the Portenta X8, it is possible to compile and run Arduino example sketches (included in the IDE) using Serial functionality without any additional modification.

The Arduino website mentions the ability to run Arduino code on the auxiliary core of the Portenta X8 in many places, including:

The examples version

5d991a2

Additional context

Repeatable with Arduino IDE 2.3.2
image

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest version
  • My report contains all necessary details

Hi @aliphys. The examples hosted in this repository are intended to serve as an introduction to the Arduino programming language. Although we could add support to the examples for the Portenta X8, the added added code would make the examples significantly less approachable to beginners.

Since the Portenta X8 is a "PRO" product, which is only for use by advanced users, it is not worth making harmful changes to the examples hosted in this repository in order to support that board.