M5CoreS3 icon indicating copy to clipboard operation
M5CoreS3 copied to clipboard

PlatformIO: can't build using the sample platformio.ini file

Open AmedeeBulle opened this issue 2 years ago • 0 comments

In a new project, I have the following platformio.ini, based on the sample one in this repo:

[env:m5stack-cores3]
platform = espressif32
board = m5stack-cores3
framework = arduino
upload_speed = 1500000
monitor_speed = 115200
monitor_filters = time
build_flags = 
	-DESP32S3
	-DBOARD_HAS_PSRAM
	-mfix-esp32-psram-cache-issue
	-DCORE_DEBUG_LEVEL=5
	-DARDUINO_USB_CDC_ON_BOOT=1
	-DARDUINO_USB_MODE=1
lib_deps = 
	m5stack/M5CoreS3@^0.0.4
	tinyu-zhao/BMI270_Sensor@^0.0.1

Build stage will produce:

.pio/libdeps/m5stack-cores3/M5CoreS3/src/utility/I2C_IMU.cpp: In constructor 'I2C_IMU::I2C_IMU()':
.pio/libdeps/m5stack-cores3/M5CoreS3/src/utility/I2C_IMU.cpp:10:5: error: 'USBSerial' was not declared in this scope
     USBSerial.begin(115200);
     ^~~~~~~~~
.pio/libdeps/m5stack-cores3/M5CoreS3/src/utility/I2C_IMU.cpp:10:5: note: suggested alternative: 'Serial'
     USBSerial.begin(115200);
     ^~~~~~~~~
     Serial
     ...

The issue seems to come from the flag -DARDUINO_USB_CDC_ON_BOOT=1; it runs fine when the macro is set to 0. I am not sure though if there are further implications.

Also, I see platformio.ini uses board = esp32-s3-devkitc-1. What are the differences with board = m5stack-cores3?

AmedeeBulle avatar Sep 12 '23 10:09 AmedeeBulle