ESP32 S3 DevKitC-1 N16R8 - using PSRAM - howto

So people in the ESP32 Platformio community also seem to be struggling with getting the N32R8V to work

They too had problems with this device entering a boot loop

One post suggested this platformio.ini configuration works:

platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino
board_upload.flash_size = 16MB
board_build.partitions = default_16MB.csv
build_flags = 
    -DBOARD_HAS_PSRAM 
    -mfix-esp32-psram-cache-issue
board_build.arduino.memory_type = opi_opi

They said the “memory_type = opi_opi” was the crucial element

I have tried to recrate this for ESPHome but the flash types don’t allow opi_opi

Here is the original post: ESP32-S3-DevKitC-1-N32R8V configuration assistance - Development Platforms - PlatformIO Community

Any ideas?

The issue seems to have been reported more than a year ago on GitHub: ESP32-S3-WROOM-2 reboot loop after flash · Issue #4149 · esphome/issues · GitHub

For me I had success with the following setting (warning - this is just copy and pasted what i found in the net):

esphome:
  name: ${dev_name}
  friendly_name: ${dev_name}
  comment: AI-S3
  platformio_options:
    board_build.flash_mode: dio

esp32:
  board: lolin_s3
  flash_size: 16MB
  framework:
    type: esp-idf
    sdkconfig_options:
      CONFIG_ESP32_S3_BOX_BOARD: "y"
  
psram:
  mode: octal
  speed: 80MHz


...

light:
  - platform: status_led
    # this is the green LED
    id: led43
    pin:
      number: GPIO43
      inverted: true
  - platform: binary
    output: light_output
    id: led_blue
    name: "Onboard LED blue"    
  - platform: esp32_rmt_led_strip
    rgb_order: GRB
    pin: GPIO48
    num_leds: 1
    rmt_channel: 0
    chipset: ws2812

output:
  - id: light_output
    # this is the blue LED
    platform: gpio
    pin:
      number: GPIO44
      inverted: true

might be this helps someone - might be someone has improvements?

2 Likes

i recently bought the " ESP32 S3 UNO N16R8 ESP32 S3 WROOM1 ". Not much available on this board but this post seems clossest…
I have the board basicly working (onboard RGB flashing) with arduino IDE as an ESP32S3 dev module.
Should the code above also be working on this board?

Happy to see that this thread is evolving and serving the purpose initially intended :slight_smile:

W.r.t. the specific board, keeping in mind that I’m not an expert, but in general, the board definitions determine how the pin-out is specified etc. So, if the pinout of this uno-board matches one of the known ones, it should be usable. Otherwise it might be that pin references do not work (or not all of them work).

At the moment, the platformio site only lists one esp32 ‘UNO’ but that doesnt appear to be an S3 one, so you could simply try the above codes, and see if it behaves as you expect it to…

Has anyone gotten the esp32-s3-devkitc-1 N16R8 Rev 0.2 board working? I’ve tried all of the configurations above in their exact formats. The closest I could get was using framework type esp-idf but the device never showed as online in esphome. If I try using arduino for the framework type I keep getting a core 1 panic’ed followed by a core register dump.

Log Output
[10:47:55]Rebooting...
[10:47:55]�ESP-ROM:esp32s3-20210327
[10:47:55]Build:Mar 27 2021
[10:47:55]rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
[10:47:55]Saved PC:0x4209d78e
[10:47:55]SPIWP:0xee
[10:47:55]mode:DIO, clock div:1
[10:47:55]load:0x3fce3808,len:0x39c
[10:47:55]load:0x403c9700,len:0x9bc
[10:47:55]load:0x403cc700,len:0x28dc
[10:47:55]entry 0x403c98c0
[10:48:06]Guru Meditation Error: Core  1 panic'ed (Unhandled debug exception). 
[10:48:06]Debug exception reason: Stack canary watchpoint triggered (loopTask) 
[10:48:06]Core  1 register dump:
[10:48:06]PC      : 0x40380397  PS      : 0x00060036  A0      : 0x8037eda8  A1      : 0x3fce1060  
[10:48:06]A2      : 0x3fc967a0  A3      : 0xb33fffff  A4      : 0x0000cdcd  A5      : 0x00060023  
[10:48:06]A6      : 0x00060023  A7      : 0x0000abab  A8      : 0xb33fffff  A9      : 0xffffffff  
[10:48:06]A10     : 0x00000000  A11     : 0x3fc966e0  A12     : 0x7db80000  A13     : 0x27be0000  
[10:48:06]A14     : 0x02c967a0  A15     : 0x00ffffff  SAR     : 0x0000000e  EXCCAUSE: 0x00000001  
[10:48:06]EXCVADDR: 0x00000000  LBEG    : 0x400556d5  LEND    : 0x400556e5  LCOUNT  : 0xffffffe9  
[10:48:06]
[10:48:06]
[10:48:06]Backtrace:0x40380394:0x3fce10600x4037eda5:0x3fce10a0 0x4037d308:0x3fce10d0 0x4037d2fe:0xa5a5a5a5  |<-CORRUPTED
[10:48:06]
[10:48:06]
[10:48:06]
[10:48:06]
[10:48:06]ELF file SHA256: 0000000000000000

This output repeats indefinitely.

This is the board I’m using https://www.aliexpress.us/item/3256806080061048.html - specifically the “N16R8” variant.

Config
esphome:
  name: some-device
  friendly_name: Some Device
  platformio_options:
    board_build.arduino.memory_type: qio_opi
    board_upload.maximum_ram_size: 524288

esp32:
  board: esp32-s3-devkitc-1
  variant: esp32s3
  flash_size: 16MB
  partitions: "default_16MB.csv"
  framework:
    type: arduino

psram:
  mode: octal
  speed: 80MHz

I’ve also made sure to clean my build files in between attempts to avoid cross contamination.

Attempt with esp-idf framework type

This output also repeats indefinitely

Log Output
[11:43:33]�e����i� ESP-ROM:esp32s3-20210327
[11:43:33]Build:Mar 27 2021
[11:43:33]rst:0x7 (TG0WDT_SYS_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
[11:43:33]Saved PC:0x400454d5
[11:43:33]SPIWP:0xee
[11:43:33]mode:QIO, clock div:1
[11:43:33]load:0x3fce3808,len:0x1658
[11:43:33]ets_loader.c 78 
[11:43:33]ESP-ROM:esp32s3-20210327
[11:43:33]Build:Mar 27 2021
[11:43:33]rst:0x10 (RTCWDT_RTC_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
[11:43:33]SPIWP:0xee
[11:43:33]mode:QIO, clock div:1
[11:43:33]load:0x3fce3808,len:0x1658
[11:43:33]ets_loader.c 78
Config
esphome:
  name: some-device
  friendly_name: Some Device

esp32:
  board: esp32-s3-devkitc-1
  variant: esp32s3
  framework:
    type: esp-idf
    version: recommended
    sdkconfig_options:
      CONFIG_ESP32_S3_BOX_BOARD: "y"

psram:
  mode: octal
  speed: 80MHz

To be honest, not sure what ‘rev’ mine is, but did you also try the config from the start post? As the board seems awfully similar (other than a different color).

My other question would be, are you sure the board is not faulty? When I can’t get ESPHome to work, I typically try uploading some arduino code examples for the given board/sensor (and use the config options for the boards in the arduino software) to see if I can get that to work.

Other than that, I’m afraid I can’t help you…sorry…

I appreciate the quick response - that was the first one I tried. Just tried again and similar core panic log output.

That was my final fall back - I will try using arduino code examples to verify. Thanks!

Edit - I discovered the issue was I’m trying to connect a display to my esp32s3 and it was causing this issue. When I remove the code to initialize the display everything runs as expected. So either there is some compatibility issue with this display and the board or I’m missing something altogether. I’m using the 2.4in display from here aliexpress.us/item/3256805987125685.html

1 Like

Just stumbled across this thread while trying to find out about PSRAM, following a failed attempt to upgrade my current LED display on an ESP device that I built some time ago.
I’m currently running a Wemos D1 Mini Pro with external antennae, due to the device living outdoors and needing the extra WiFi range. This uses an ESP8266 and a small Waveshare 0.96" LCD ST7735S Controller.
I purchased a Waveshare 2.4" LCD with ILI9341, after checking this display was compatible with ESPHome.
Compiling in ESPHome went fine after updating the code for the new display, however the Device started showing as offline, with no API output. Commenting out the code of the display and reflashing brought the device back online again, so this lead me to realise that the ILI9341 requires a board with PSRAM, and is not well suited to an ESP8266.

Looks like I need a new, more powerful board, so either an ESP32 board with external WiFi antenna and PSRAM, or one with just PSRAM like the example linked in the first post here, and some soldering required for the antenna connection.

@bsell93 I’m keen to hear whether you manage to make progress with your particular display and board :crossed_fingers:

Hey @Scoff - seems we are on a similar path. This thread may be helpful to you Work in progress! esphome thermostat - #18 by GreyLinux

From what I can see the ILI9341 works with esp32 dev board like this https://www.amazon.com/dp/B08D5ZD528

I’ve got one of these amazon.com/gp/product/B0B1M9S9V6 on order to verify that.

I’ve not been able to get my esp32-s3 to work with my ST7735 display unfortunately. It’s unfortunate because the esp32s3 seems like a much more capable board - I don’t have the knowledge to know if they can work together and if so how.

From what I can see the ST77xx displays require two SPI interfaces for the display and the touchscreen to work. The basic esp32 devices unfortunately only have one. So in my case I was able to get a esp32 d1 mini to properly render content on the ST7735, but I wasn’t able to utilize the touchscreen capabilities. But the esp32s3 has multiple options for SPI interfaces, but unfortunately I can’t get past a RAM overflow issue to get the display to even initialize and display.

Edit: I have had success using the above linked display and board combination - touch and display functionality works as expected. The config from the thread I linked was the basis of that success.

1 Like

Thanks @bsell93 those links were very useful!

I’ve given it a try with one of my generic no name ESP32 Devkit v1 boards, which doesn’t have any PSRAM, and it does work OK with my display, providing I don’t try to put too much on the screen, as I get warnings about allocating display buffer.
I’ll see what the WiFi signal strength is like and if necessary, do some soldering for an external antenna.

1 Like

Did someone got this to work properly with ESPHome?

N16R8 KIT

I tried some of the provided snippets here, but I got a boot loop or a boot stop.
Install itself seemed to work, but I can not access it via OTA.

“Webserial not available” or something like that.

I tried it as a voice assistant

esphome:
  name: assist-2
  friendly_name: Asistent 2
  platformio_options:
    board_build.flash_mode: dio


esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: esp-idf

    sdkconfig_options:
      CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240: "y"
      CONFIG_ESP32S3_DATA_CACHE_64KB: "y"
      CONFIG_ESP32S3_DATA_CACHE_LINE_64B: "y"
      CONFIG_AUDIO_BOARD_CUSTOM: "y"
   
psram:
  mode: octal  # quad for N8R2 and octal for N16R8
  speed: 80MHz

I was able to bring up the ESP32-S3-DevKitC-1 N16R8 using this configuration and esphome 2024.11:

esphome:
  name: test
  friendly_name: test
  name_add_mac_suffix: true
  min_version: 2024.9.0
  platformio_options:
    board_build.flash_mode: dio 
  on_boot: 
    then:
      - light.turn_on:
          id: rgb_led # must be physically connected on the dev board
          effect: slow_pulse
          red: 100%
          green: 60%
          blue: 0%

esp32:
  board: esp32-s3-devkitc-1
  variant: esp32s3
  flash_size: 16MB  
  framework:
    type: esp-idf
    version: recommended
    sdkconfig_options:
      CONFIG_ESP32_S3_BOX_BOARD: "y"
  
psram:
  mode: octal
  speed: 80MHz

api:

logger:
  level: debug

ota:
  platform: esphome

wifi:
  ssid: ...
  password: ...
  #ap:
  fast_connect: true
  #manual_ip: # setting an ip manually helped in connecting to the controller
    #static_ip: 192.168.0.203
    #gateway: 192.168.0.1
    #subnet: 255.255.255.0

#captive_portal: # captive portal and wifi ap seemed to break wifi connectivity

improv_serial:

sensor:
  - platform: wifi_signal
    name: "WiFi Signal Sensor"
    update_interval: 3s

light:
  - platform: esp32_rmt_led_strip
    name: "RGB LED"
    id: rgb_led
    rgb_order: GRB
    pin: GPIO48
    num_leds: 1
    rmt_channel: 0
    chipset: ws2812
    effects:
      - pulse:
          name: slow_pulse
          transition_length: 1s
          update_interval: 2s

Unfortunately, the controller appears to be unusually sluggish, and I can’t determine the cause. One board isn’t responding at all, while another takes anywhere from 10 seconds to 5 minutes to connect to Wi-Fi after starting up. It is supposed to report the Wi-Fi signal strength every 3 seconds, but this reporting is very inconsistent. It occasionally pauses completely, then recovers by outputting 10–20 updates at once before stopping again. This behaviour seems tied to Wi-Fi connectivity - when I’m close to my access point, it works better, but it deteriorates when I’m about 5 meters away.

Does anyone have any tips or suggestions for addressing this issue?

See this issue: ESP32-S3-DevKitC-1 N16R8 is really sluggish, wifi problems · Issue #6456 · esphome/issues · GitHub

EDIT: setting output_power: 8.5db in the wifi section helped a lot with connectivity and the device is now fast.

Okay, I was finally able to get the thing to work and act as a Media-Player with a connected AMP and speaker, including PSRAM.

Just for completeness of this post:
Hardware I’ve used:

  • ESP32-S3-DevKitC-1 N16R8 (connected the RGB LED through soldering on the board)
  • MAX98357 Amplifier
  • Some generic 4Ohm 5W speaker
  • A 5V 2A power supply, connected to the 5Vin and GND ports of the DevKit

Software I’ve used:

  • ESPHome 2024.11.0
  • Modified esp-idf audio toolkit

Tricks I’ve applied:

  • wifi output_power: 8.5db was needed to get the device into my Wi-Fi reliably. Without it, it either wasn’t able to connect (auth error) or reported values really slow and often dropped some. This seems related to this discussion: ESP32-C3 Disconnected reason='Auth Expired' · Issue #4893 · esphome/issues · GitHub
  • The 5V pin on the DevKit won’t supply 5V when powered over USB-C. Thus, I’ve attached a power supply to the 5Vin and GND pins, powering my external components and my DevKit (no USB-C needed)

Code I’ve used (full example for the media player):

external_components:
  - source:
      type: git
      url: https://github.com/gnumpi/esphome_audio
      ref: dev-next
    components: [adf_pipeline, i2s_audio]

esphome:
  name: diy-voice-assistant
  friendly_name: DIY Voice Assistant
  name_add_mac_suffix: true
  min_version: 2024.9.0
  platformio_options:
    board_build.flash_mode: dio 
  on_boot: 
    then:
      - light.turn_on:
          id: rgb_led
          effect: fast_pulse
          red: 0%
          green: 0%
          blue: 50%
      - media_player.volume_set: 70%
      - wait_until:
          condition:
            wifi.connected:
      - light.turn_on:
          id: rgb_led
          effect: slow_pulse
          red: 0%
          green: 50%
          blue: 0%
      - wait_until:
          condition:
            api.connected:
      - light.turn_on:
          id: rgb_led
          effect: slow_pulse
          red: 100%
          green: 50%
          blue: 0%

esp32:
  board: esp32-s3-devkitc-1
  variant: esp32s3
  flash_size: 16MB  
  framework:
    type: esp-idf
    version: recommended
    sdkconfig_options:
      CONFIG_ESP32_S3_BOX_BOARD: "y" # this is needed for the custom component
  
psram:
  mode: octal
  speed: 80MHz

api:

logger:

ota:
  platform: esphome

wifi:
  ssid: ...
  password: ...
  output_power: 8.5dB # this was very important for me
  power_save_mode: none # maybe not needed
  fast_connect: true
  manual_ip: # helped while experimenting, maybe not needed
    static_ip: 192.168.0.203
    gateway: 192.168.0.1
    subnet: 255.255.255.0
  ap:

captive_portal:

improv_serial:

sensor:
  - platform: wifi_signal
    name: "WiFi Signal Sensor"
    update_interval: 5s # to find regular reported statements in wireless esphome logs

light:
  - platform: esp32_rmt_led_strip
    name: "RGB LED"
    id: rgb_led
    rgb_order: GRB
    pin: GPIO48
    num_leds: 1
    rmt_channel: 0
    chipset: ws2812
    effects:
      - pulse:
          name: slow_pulse
          transition_length: 0.5s
          update_interval: 1s
      - pulse:
          name: fast_pulse
          transition_length: 0.25s
          update_interval: 0.5s

i2s_audio:
  - id: i2s_shared
    i2s_lrclk_pin: GPIO15
    i2s_bclk_pin: GPIO16
    access_mode: duplex

adf_pipeline:
  - platform: i2s_audio
    type: audio_out
    id: adf_i2s_out
    i2s_audio_id: i2s_shared
    i2s_dout_pin: GPIO17
    bits_per_sample: 32bit
    sample_rate: 48000
    alc_max: .5
    use_apll: true
    fixed_settings: true
    channel: right_left

media_player:
  - platform: adf_pipeline
    id: media_out
    name: Media Player
    internal: false
    keep_pipeline_alive: true
    pipeline:
      - self
      - resampler
      - adf_i2s_out
1 Like

First point 5V can be supplied if you bridge 2 solder pads as per this discussion.

Second point, is if I had read this more often I would have pointed you here.

As this works fine as a media player except some radio stations, which if fed from Music assistant work fine.

I do not want to tag onto this thread, but the OP covered exactly what I am trying to do. Being that the original post date was a year ago though, not sure if I should start my own thread.

I have the same type of board, but it is more legacy. It’s an R8N8 (not R16N8) so it still has 8mb of PSRAM but only 8mb of flash. It is an Espressif board with 2 USB Mini connectors. One is a UART and the other is JTAG, etc.

No matter what I have tried using ESPHome addon in Home Assistant, I cannot get the compiler to recognize the PSRAM. The only thing I have not done yet is create the partition CSV and place it in the project’s folder. I was going to but doing a google search, results I got said it would be created automatically and there was no need to do it manually. I believe that was stated in a AI response and I have seen errors before with Google’s AI responses, so I took it with a grain of salt.

So I was going to go after creating that CSV but then I read that I need to set the voltage also for the PSRAM. I certainly do not want to damage my two boards so I decided to come back to this thread and ask.

I also worry about manually setting up partitioning because I do not know (yet) how it might affect OTA. And I wondered if ESPHome uses it out-of-view to handle the OTA firmware updates from the addon in HA.

If I am not using the PSRAM and have it, and using it helps my LED Effects automation, then this is definitely something that I want. So far, effects animations are mostly good but have caveats, like a flicker pulse of light at the tail end of a fade, etc.

I think maybe I will go ahead and buy the R16N8 that was mentioned in this thread and try those out. The specs on my two legacy boards are flaky, because versioning issues show two different boards. I got them on Amazon 7 years ago.

2 PACK Espressif ESP32 ESP32-DEVKITC inc ESP-WROOM-32 soldered dils CE FCC Rev 1 Silicon for $25.

I thought maybe I need to set up a custom board for platformio as I did on my Windows 11 machine. I use PIO with VSC there. And sure enough, I have a custom board setup. And no I have not tried or checked if I am using the PSRAM on that platform. I went looking in the config files to see if I could duplicate that board setup in the HAOS but could not find anything related.

Again, no wish or desire to hijack this thread. And if recommended, I’ll post a new thread with this issue. It’s just that the OP covered 99.9% of what I wanted with such a similar board but it is not working for me.

Thanks!

I’ve been struggling with a similar Aliexpress purchase: S3 Expansion Board N16R8 KIT . I got the same error trying to flash the board with ESPHome Web about “Web serial”. Other times I got errors about the ESP32 not recognised, this may have been when attempting to upload a previously built binary.

What worked for me was to use the Home Assistant ESPHome integration and connect to the ESP32 via “usb port running Home Assistant server”. In my case I’m running Home Assistant Supervised on a raspberry pi4.

Interesting that you suggested that. I set up a separate ESPHome on my Windows 11 machine and it updates OTA just fine with the occasional error popups I just click OK on and they just go away. Weird, but it is definitely working. Maybe in that new environment I can get the PSRAM options to work. I thought I had it with HA on the Yellow when I saw PSRAM ENABLED and the actual size show in the install logs. But subsequent flashes include one RIGHT AFTER my success since then do not show ANYTHING about PSRAM. Like what… it was just based on some border-line analog condition to only work that one time? Very frustrating!!
Anyway, one issue I noticed is I can either edit the code for the device on my Windows install OR the HA Yellow, but not on both. But the compiling is MUCH faster on my Windows 11 so I do my coding there, then try to implement the features on the discovered device on the HA Yellow.
Both my ESP32-S3 dual USB port development kits are Espressif but the caveat is there are versions 1.0 and 1.1. Both versions claim 8mb flash and 8mb PSRAM.

Thanks! That helped me out with the exact same problem.

1 Like