platformio / platform-espressif32

Espressif 32: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/espressif32
Apache License 2.0
936 stars 635 forks source link

support for sparkfun esp32-s3 thing plus board #1463

Open Vigeant opened 2 months ago

Vigeant commented 2 months ago

Good day, still exploring how to do this myself but though I would mention it here.

Please add support for the sparkfun esp32-s3 thing plus board. I noticed that you have many esp32-s3 boards already so should be a quick addition.

Vigeant commented 2 months ago

@valeros I started doing the work and have written the json file, the entry in the boards.txt and the variant folder for the arduino framework. It all compiles and uploads but the code does not run. Any clue how to debug this. My arduino framework additions work with the arduino ide 2.0 (I can compile, upload and execute).

valeros commented 1 month ago

Hi @Vigeant, share here your board manifest. What code do you use to verify the board is working?

Vigeant commented 1 month ago

hi @valeros attached is my current json file. sparkfun_esp32s3_thing_plus.json

I am using a simple blink demo

/*
 * Blink
 * Turns on an LED on for one second,
 * then off for one second, repeatedly.
 */

#include <Arduino.h>

// Set LED_BUILTIN if it is not defined by Arduino framework
#ifndef LED_BUILTIN
    #define LED_BUILTIN 46
#endif

#define LED_BUILTIN 0

void setup()
{
  // initialize LED digital pin as an output.
  pinMode(LED_BUILTIN, OUTPUT);
  Serial.begin(115200);
}

void loop()
{
  // turn the LED on (HIGH is the voltage level)
  digitalWrite(LED_BUILTIN, HIGH);
  Serial.println("LED on");
  // wait for a second
  delay(1000);
  // turn the LED off by making the voltage LOW
  digitalWrite(LED_BUILTIN, LOW);
  Serial.println("LED off");
   // wait for a second
  delay(1000);
}

the json file refers to the arduino board I wrote. I did a pull request for it but will take a while for it to propagate.

Is there a way to refer to something local instead of the arduino stuff?

valeros commented 1 month ago

I see you've used sparkfun_esp32s3_thing_plus in the variant field. There is no such variant folder in the Arduino core v2.x which is used by PlatformIO at the moment. This makes me think you're using a custom dev-platform or a fork? Does the board print anything to the console?

Vigeant commented 1 month ago

hi @valeros thats correct, I wrote my own based on the generic esp32-s3 dev board and yes I had the demos working. Yesterday I tried pointing my platformio.ini to the github repo since my pull request was merged in the arduino master recently but still having trouble.

Here is my platformio.ini

[env:sparkfun_esp32s3_thing_plus]
platform = https://github.com/platformio/platform-espressif32.git
;platform = espressif32
board = sparkfun_esp32s3_thing_plus
framework = arduino
;may need to update lib link to latest version https://github.com/espressif/esp32-arduino-lib-builder/releases
; see this for additional details https://github.com/platformio/platform-espressif32/issues/1225
platform_packages = 
    framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32#master
    framework-arduinoespressif32-libs @ https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-33fbade6.zip
monitor_speed = 115200
board_build.mcu = esp32s3
board_build.f_cpu = 240000000L

I get the following error when trying to compile

Processing sparkfun_esp32s3_thing_plus (platform: https://github.com/platformio/platform-espressif32.git; board: sparkfun_esp32s3_thing_plus; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/sparkfun_esp32s3_thing_plus.html
PLATFORM: Espressif 32 (6.9.0+sha.61e9531) > SPARKFUN_ESP32S3_THING_PLUS
HARDWARE: ESP32S3 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-builtin) On-board (esp-builtin) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
 - framework-arduinoespressif32 @ 3.0.5+sha.f083e2d
 - framework-arduinoespressif32-libs @ 5.1.0+sha.33fbade6b8
 - tool-esptoolpy @ 1.40501.0 (4.5.1)
 - tool-mkfatfs @ 2.0.1
 - tool-mklittlefs @ 1.203.210628 (2.3)
 - tool-mkspiffs @ 2.230.0 (2.30)
 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch5
 - toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 40 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio\build\sparkfun_esp32s3_thing_plus\src\Blink.cpp.o
xtensa-esp32s3-elf-g++: error: unrecognized command line option '-std=gnu++2b'; did you mean '-std=gnu++2a'?
Compiling .pio\build\sparkfun_esp32s3_thing_plus\FrameworkArduino\Esp.cpp.o
*** [.pio\build\sparkfun_esp32s3_thing_plus\src\Blink.cpp.o] Error 1
xtensa-esp32s3-elf-g++: error: unrecognized command line option '-std=gnu++2b'; did you mean '-std=gnu++2a'?
*** [.pio\build\sparkfun_esp32s3_thing_plus\FrameworkArduino\Esp.cpp.o] Error 1
============================================================================== [FAILED] Took 1.95 seconds 
Vigeant commented 1 month ago

not sure how to go about officially adding a board and use platformio. I guess I could fork the last 2.0 build and add my board and point to my fork. Is there a timeline for platformIO to move to core V3.x?

valeros commented 1 month ago

I'm afraid I cannot help you here with third-party implementations. As for support for v3.x, see #1225.

Jason2866 commented 1 month ago

@Vigeant Your platform_packages is wrong use

platform = https://github.com/platformio/platform-espressif32.git
platform_packages = 
  framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.5
  framework-arduinoespressif32-libs @ https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-33fbade6.zip

to use core 3.0.5