platform-espressif32 icon indicating copy to clipboard operation
platform-espressif32 copied to clipboard

support for sparkfun esp32-s3 thing plus board

Open Vigeant opened this issue 1 year ago • 22 comments

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 avatar Sep 19 '24 00:09 Vigeant

@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).

Vigeant avatar Sep 27 '24 18:09 Vigeant

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

valeros avatar Sep 30 '24 12:09 valeros

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?

Vigeant avatar Oct 09 '24 00:10 Vigeant

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?

valeros avatar Oct 09 '24 09:10 valeros

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 avatar Oct 09 '24 14:10 Vigeant

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?

Vigeant avatar Oct 09 '24 14:10 Vigeant

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

valeros avatar Oct 10 '24 11:10 valeros

@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

Jason2866 avatar Oct 10 '24 12:10 Jason2866

What are the blockers for resolving this issue - can I help in any way? I have this board and would love to get it working. Are there any workarounds?

jeremiahrose avatar Dec 20 '24 08:12 jeremiahrose

Espressif dropping support for platformio...

On Fri, Dec 20, 2024, 3:10 a.m. Jeremiah Rose @.***> wrote:

What are the blockers for resolving this issue - can I help in any way? I have this board and would love to get it working. Are there any workarounds?

— Reply to this email directly, view it on GitHub https://github.com/platformio/platform-espressif32/issues/1463#issuecomment-2556488969, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABIRPK7YGWIJFB3Q6VL7VOD2GPGIXAVCNFSM6AAAAABOO2CHBGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNJWGQ4DQOJWHE . You are receiving this because you were mentioned.Message ID: @.***>

Vigeant avatar Dec 20 '24 11:12 Vigeant

@jeremiahrose If you look https://github.com/platformio/platform-espressif32/issues/1225#issuecomment-2529060276 you have a solution.

Jason2866 avatar Dec 20 '24 11:12 Jason2866

@jeremiahrose I don't understand why you can't proceed, just use the pioarduino fork and that's that.

As to the reasons for the falling out between Espressif and PlatformIO, this is extensively discussed in #1225, and nothing any of us say here is likely to change the situation.

In my experience, the new fork is very actively maintained, works well, and it's extremely easy to switch to using it.

kylefmohr avatar Dec 22 '24 00:12 kylefmohr

@kylemohr thanks for the reply. The pioarduino fork doesn't have a sparkfun_esp32s3_thing_plus board either! So what would it take to solve this issue, either in this repo or the fork? Should we transfer this issue over to the fork? Is it documented somewhere that Espressif board requests should be posted there, and not here?

jeremiahrose avatar Dec 22 '24 00:12 jeremiahrose

@jeremiahrose Right, you have to remember that the people running this fork are volunteers -

I would recommend opening a PR in pioarduino/platform-espressif32, take a look at merged PRs to see how others have been adding boards: https://github.com/pioarduino/platform-espressif32/pulls?q=is%3Apr+is%3Aclosed

kylefmohr avatar Dec 22 '24 00:12 kylefmohr

Roger that, thanks @kylefmohr .

For reference, here is @Vigeant 's PR in the Arduino core: https://github.com/espressif/arduino-esp32/pull/10382

jeremiahrose avatar Dec 22 '24 00:12 jeremiahrose

@jeremiahrose if you'd like to get started immediately, use this as your platformio.ini file

; Flash: 4MB QD, PSRAM: 2MB QD
[env:esp32-s3-devkitc-1]
board = esp32-s3-devkitc-1
platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip
framework = arduino

board_build.arduino.memory_type = qio_qspi
board_build.flash_mode = qio
board_build.psram_type = qio
board_upload.flash_size = 4MB
board_upload.maximum_size = 4194304
board_build.extra_flags = 
  -DBOARD_HAS_PSRAM

I sourced this from this repo and this hardware description of the board

kylefmohr avatar Dec 22 '24 00:12 kylefmohr

Thanks so much @kylefmohr. The above environment didn't quite work, but by doing a diff between @Vigeant's .json and the esp32-s3-devkitc-1.json, I was able to fill in the missing settings. This environment is working perfectly for me so far:

[env:sparkfun_esp32s3_thing_plus]
board = esp32-s3-devkitc-1
platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip
framework = arduino
board_build.arduino.memory_type = qio_qspi
board_build.arduino.partitions = default.csv
board_build.flash_mode = qio
board_build.psram_type = qio
board_build.cdc_on_boot = 1
board_upload.flash_size = 4MB
board_upload.maximum_size = 4194304
board_build.extra_flags =
  -DARDUINO_USB_CDC_ON_BOOT=1

jeremiahrose avatar Dec 22 '24 04:12 jeremiahrose

Have added this workaround to the Sparkfun documentation: https://github.com/sparkfun/SparkFun_Thing_Plus_ESP32-S3/pull/3

jeremiahrose avatar Dec 22 '24 05:12 jeremiahrose

the json file refers to the arduino board I wrote. I did a pull request for it

@Vigeant I couldn't find the pull request for your board manifest, so I have created a new one over at pioarduino/platform-espressif32: https://github.com/pioarduino/platform-espressif32/pull/89

jeremiahrose avatar Dec 22 '24 05:12 jeremiahrose

Sorry, I gave up on platformio and moved to esp-idf.

On Sun, Dec 22, 2024, 12:50 a.m. Jeremiah Rose @.***> wrote:

the json file refers to the arduino board I wrote. I did a pull request for it

@Vigeant https://github.com/Vigeant I couldn't find the pull request for your board manifest, so I have created a new one over at pioarduino/platform-espressif32: pioarduino#89 https://github.com/pioarduino/platform-espressif32/pull/89

— Reply to this email directly, view it on GitHub https://github.com/platformio/platform-espressif32/issues/1463#issuecomment-2558341390, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABIRPK7VW72CKF7X75EMNAT2GZHKJAVCNFSM6AAAAABOO2CHBGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNJYGM2DCMZZGA . You are receiving this because you were mentioned.Message ID: @.***>

Vigeant avatar Dec 22 '24 09:12 Vigeant

https://github.com/pioarduino/platform-espressif32/pull/89 has been merged, so we don't need the workardound anymore. Just pull the development version of pioarduino/platform-espressif32 like so:

[env:sparkfun_esp32s3_thing_plus]
framework = arduino
platform = https://github.com/pioarduino/platform-espressif32.git#develop
board = sparkfun_esp32s3_thing_plus

jeremiahrose avatar Dec 22 '24 20:12 jeremiahrose

I've updated the PR to Sparkfun's documentation to reflect this. I guess we can close this issue now, unless we want to wait for pioarduino/platform-espressif32 to cut a new release.

jeremiahrose avatar Dec 22 '24 20:12 jeremiahrose