Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ESP32-S3-WROOM-1-N4R2 #1389

Open
nicola-reat opened this issue Jun 3, 2024 · 8 comments
Open

Add support for ESP32-S3-WROOM-1-N4R2 #1389

nicola-reat opened this issue Jun 3, 2024 · 8 comments

Comments

@nicola-reat
Copy link

Hi everyone, I would like to ask if anyone has already used an esp32-s3-wroom1-n4r2 with platformio

@Jason2866
Copy link
Contributor

yes.

@nicola-reat
Copy link
Author

yes.
@Jason2866

Okk can you send me your configuration??

@Jason2866
Copy link
Contributor

this boards json

{
  "build": {
    "arduino": {
      "memory_type": "qio_qspi"
    },
    "core": "esp32",
    "extra_flags": [
      "-DBOARD_HAS_PSRAM",
      "-DARDUINO_RUNNING_CORE=1",
      "-DARDUINO_EVENT_RUNNING_CORE=1"
    ],
    "f_cpu": "240000000L",
    "f_flash": "80000000L",
    "flash_mode": "qio",
    "mcu": "esp32s3",
    "variant": "esp32s3"
  },
  "connectivity": [
    "wifi",
    "bluetooth"
  ],
  "debug": {
    "openocd_target": "esp32s3.cfg"
  },
  "frameworks": [
    "arduino",
    "espidf"
  ],
  "name": "WROOM-1-N4R2",
  "upload": {
    "flash_size": "4MB",
    "maximum_ram_size": 327680,
    "maximum_size": 4194304,
    "require_upload_port": true,
    "speed": 460800
  },
  "url": "https://www.espressif.com",
  "vendor": "espressif"
}

@nicola-reat
Copy link
Author

this boards json

{
  "build": {
    "arduino": {
      "memory_type": "qio_qspi"
    },
    "core": "esp32",
    "extra_flags": [
      "-DBOARD_HAS_PSRAM",
      "-DARDUINO_RUNNING_CORE=1",
      "-DARDUINO_EVENT_RUNNING_CORE=1"
    ],
    "f_cpu": "240000000L",
    "f_flash": "80000000L",
    "flash_mode": "qio",
    "mcu": "esp32s3",
    "variant": "esp32s3"
  },
  "connectivity": [
    "wifi",
    "bluetooth"
  ],
  "debug": {
    "openocd_target": "esp32s3.cfg"
  },
  "frameworks": [
    "arduino",
    "espidf"
  ],
  "name": "WROOM-1-N4R2",
  "upload": {
    "flash_size": "4MB",
    "maximum_ram_size": 327680,
    "maximum_size": 4194304,
    "require_upload_port": true,
    "speed": 460800
  },
  "url": "https://www.espressif.com",
  "vendor": "espressif"
}

Thanks so much

@Jason2866
Copy link
Contributor

Take care to use a matching partition scheme! Every scheme for 4MB flash will work.

@nicola-reat
Copy link
Author

Take care to use a matching partition scheme! Every scheme for 4MB flash will work.

Yes, thanks, I'll implement it now

@robertlipe
Copy link

Unfortunately, while Espressif and Platformio are at a stalemate, I don't see a lot of merges being accepted to add changes like this.

If you control the project and not the build system (perhaps you're distributing open source and don't want to coach people into modifying their build systems or you don't have write access to the platformio directory) you can also get most of the juice from this orange in your own platformio.ini.

I've started to split my customizations to the .ini into triplets or quartets. One for the chip. One for the module. One for the board. One for the project. Yes, it's a bit tortured. This runs pretty firmly into a speed bump by 'extends' not actually working sensibly (though tickets to that topic get closed as 'working as documented') but it's workable. Relevant snippets from an active project for that module's bigger sibling.

This isn't quite the same module as you have, but it may provide inspirational for anyone else using modern-ish Espressif parts and trying to just make a working binary.

This may still technically be a bit over-described, but it's what's in my tree right now, though it's a work in progress. The key for these s3-nNrR modules really is to dial in the memory type as qspi (most boards > 2MB have ospi, not qspi - that's a frequent trap) and to set the BOARD_HAS_PSRAM flag and flash_size. Otherwise, the code will boot loop if it loads at all.

[dev_esp32-s3]
extends         = base
board           = esp32-s3-devkitc-1
board_build.mcu = esp32s3
board_build.f_cpu = 240000000L
monitor_speed   = 115200
upload_speed    = 1000000

; This describes a specific MODULE from Espressif. It may appear on different BOARDS.
[dev_esp32-s3-n16r2]
extends         = dev_esp32-s3
build_flags     = -DUSE_PSRAM=1
                  -DBOARD_HAS_PSRAM=1
                  ${dev_esp32-s3.build_flags}
board_build.arduino.memory_type = qio_qspi
board_build.partitions = default_16MB.csv
board_upload.flash_size = 16MB

[dev_yulc]
extends         = dev_esp32-s3-n16r2
build_unflags   = -DARDUINO_USB_MODE=1
build_flags     = -DARDUINO_USB_CDC_ON_BOOT=1 ; Counterintuitively, CDC = 1 lets USB Serial mode work.
                  -DARDUINO_USB_MODE=0 ; “Hardware CDC and JTAG” instead of "TinyUSB"
                  -DLED_PIN0=1 # These pins are defined by the hardware
                  -DLED_PIN1=2 # GPIO 2
                  ${dev_esp32-s3-n16r2.build_flags}
                  
[env:yulc-hexagon]
extends         = dev_esp32-s3-n16r2
build_flags     =-DHEXAGON=1
                  -DENABLE_WIFI=1
                  -DENABLE_NTP=1
                  -DENABLE_OTA=1
                  -DENABLE_WEBSERVER=1
                  -DPOWER_LIMIT_MW=1000  # turn down brightness for now
                  ${dev_yulc.build_flags}
lib_ignore      = Bounce2
                  IRremoteESP8266
                  U8g2
                  QRCode

The plan is to build up in layers. Describe the chip. Describe the package. Describe the eval board/hardware. Describe the project running on the hardware.

@nikito7
Copy link

nikito7 commented Aug 27, 2024

It works ok with Tasmota

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants