Hi There,
I am having issue with CoreS3: UART on Port.C does not work in Platformio with Arduino framework.
The same code works with Core2 v1
Already tried swapping pin 17 and 18 but nothing on the oscilloscope.
Already tried using serial2 instead of HardwareSerial 2.
Did anyone face similar issue?
main.cpp:
#include <Arduino.h>
#include <Wire.h>
#include <M5Unified.h>
#define CORE_S3
#ifdef CORE_S3
static const int SERVO_UART_TX = 17;
static const int SERVO_UART_RX = 18;
#elif defined CORE_2
static const int SERVO_UART_TX = 13;
static const int SERVO_UART_RX = 14;
#endif
//HardwareSerial SerialServo(2);
void setup() {
M5.begin(); // Init M5Core. 初始化 M5Core
// Serial2.begin(unsigned long baud, uint32_t config, int8_t rxPin, int8_t
// txPin, bool invert)
Serial.begin(115200);
// Serial2.begin(115200, SERIAL_8N1, 13,
// 14); // Init serial port 2. 初始化串口2
Serial2.begin(1000000, SERIAL_8N1, SERVO_UART_TX, SERVO_UART_RX); // Init serial port 2. 初始化串口2
M5.Lcd.printf("Started");
delay(200);
}
void loop() {
Serial.write("aaaaaaaaaaaaaaa");
Serial2.write("bbbbbbbbbbbbbb");
delay(100);
}
platformio.ini
[env:m5stack-cores3]
monitor_speed = 115200
monitor_dtr = 0
monitor_rts = 0
platform = espressif32
board = m5stack-cores3
framework = arduino
lib_deps =
m5stack/M5Unified@0.2.3