diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f7f8f1b..e6d604f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,13 +21,13 @@ jobs: - name: Build firmware for ESP32-C3 run: make BOARD=esp32:esp32:esp32c3 - name: Build firmware for ESP32-S3 - run: make BOARD=esp32:esp32:esp32s3:CDCOnBoot=cdc + run: make BOARD=esp32:esp32:esp32s3 - name: Build firmware for ESP32-S3 with QSPI PSRAM - run: make BOARD=esp32:esp32:esp32s3:CDCOnBoot=cdc,PSRAM=enabled EXTRA=--output-dir=flix/build/esp32.esp32.esp32s3.qspi + run: make BOARD=esp32:esp32:esp32s3:PSRAM=enabled EXTRA=--output-dir=flix/build/esp32.esp32.esp32s3.qspi - name: Build firmware for ESP32-S3 with OPI PSRAM - run: make BOARD=esp32:esp32:esp32s3:CDCOnBoot=cdc,PSRAM=opi EXTRA=--output-dir=flix/build/esp32.esp32.esp32s3.opi + run: make BOARD=esp32:esp32:esp32s3:PSRAM=opi EXTRA=--output-dir=flix/build/esp32.esp32.esp32s3.opi - name: Build firmware for Flix2 - run: make BOARD=esp32:esp32:esp32s3:FlashSize=4M,CDCOnBoot=cdc,PSRAM=opi FLAGS=-DFLIX2 EXTRA=--output-dir=flix/build/esp32.esp32.flix2 + run: make BOARD=esp32:esp32:esp32s3:PSRAM=opi FLAGS=-DFLIX2 EXTRA=--output-dir=flix/build/esp32.esp32.flix2 - name: Upload binaries uses: actions/upload-artifact@v7 with: diff --git a/docs/usage.md b/docs/usage.md index e7fbc50..fee4381 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -54,7 +54,7 @@ Beginners can [download the sources as a ZIP archive](https://github.com/okalach * `MAVLink`, version 2.0.25. 5. Open the `flix/flix.ino` sketch from downloaded firmware sources in Arduino IDE. 6. Connect your ESP32 board to the computer and choose correct board type in Arduino IDE (*WEMOS D1 MINI ESP32* for ESP32 Mini, *ESP32S3 Dev Module* for ESP32-S3 Super Mini) and the port. -7. Set *Tools* ⇒ *Core Debug Level* to *Error* to see the errors in the serial console. Set *Tools* ⇒ *USB CDC on Boot* to *Enabled* for ESP32-S3/ESP32-C3 boards. +7. Set *Tools* ⇒ *Core Debug Level* to *Error* to see the errors in the serial console. 8. [Build and upload](https://docs.arduino.cc/software/ide-v2/tutorials/getting-started/ide-v2-uploading-a-sketch) the firmware using Arduino IDE. #### Command line (Windows, Linux, macOS) @@ -89,7 +89,7 @@ Beginners can [download the sources as a ZIP archive](https://github.com/okalach For ESP32-S3/ESP32-C3 boards, set the appropriate [FQBN](https://docs.arduino.cc/arduino-cli/FAQ/#whats-the-fqbn-string) using `BOARD` parameter: ```bash - make BOARD=esp32:esp32:esp32s3:FlashSize=4M,CDCOnBoot=cdc upload + make BOARD=esp32:esp32:esp32s3 upload ``` See other available Make commands in [Makefile](../Makefile). diff --git a/flix/cli.ino b/flix/cli.ino index f580dab..8551538 100644 --- a/flix/cli.ino +++ b/flix/cli.ino @@ -62,6 +62,19 @@ const char* motd = "reset - reset drone's state\n" "reboot - reboot the drone\n"; +// Always redirect Serial to USB on ESP32-S3/ESP32-C3 +#if SOC_USB_SERIAL_JTAG_SUPPORTED && ARDUINO_USB_MODE +#if !ARDUINO_USB_CDC_ON_BOOT +HWCDC HWCDCSerial; +#endif +#undef Serial +#define Serial HWCDCSerial +#endif + +void setupConsole() { + Serial.begin(115200); +} + void print(const char* format, ...) { char buf[3000]; va_list args; diff --git a/flix/flix.ino b/flix/flix.ino index e91be12..ac0b037 100644 --- a/flix/flix.ino +++ b/flix/flix.ino @@ -16,7 +16,7 @@ extern bool landed; extern float motors[4]; void setup() { - Serial.begin(115200); + setupConsole(); print("Initializing Flix\n"); setupParameters(); setupPower();