As a long time lurker/reader/user of the content of this forum, I would like to do something back And in this case I would like to share how I got an ESP32 S3 DevKitC-1 working, specifically, with PSRAM working in the N16R8 config. Hope this will help someone in the (near) future who struggles with the same issue.
This is a relative new board (with Dual USB-C), as such there are some older topics on how to get the S3 in general working, but nothing about the PSRAM. Why do you wish to have this enabled? Glad you asked! Its a much needed performance boost, needed to get for example 16 bit colors out of the ILI9xxx component and helps (I think) with boosting performance to also get the touchscreen part working on relatively large displays (4" in my case) which can often be found in combination with this board (e.g. using the XPT2046 controller).
So to start off with the actual board. Its quite a common board these days that can be found on Aliexpress and the likes. In my case it was sold as a ESP32-S3 N16R8 (indicating a flash size of 16MB and a PSRAM size of 8MB). The board itself was labeled āAI-S3ā on the back, nothing more (Example here). When looking at the config and pinout, I quickly realized it followed the ESP32-S3 DevKitC-1 design. But hereās the catch, when using that board designation in an ESPHOME config, PSRAM will not be enabled by default, which caused my display to be stuck in 8bit color and causing issues with wifi connectivity (which I have come to see as an issue related to reaching the limit of the board performance). When looking at the platformIO website, one can also clearly see āNO PSRAMā stated in the name, but its not reflected in the board name you in ESPHOME.
So, the solution (for me atleast) actually turned out to be very simple, and only contains a few more lines of code:
- Add a few platformio_options, being
- A build flag indicating that the build has PSRAM
- Indicate the type of memory
- Indicate the flash size (as mine has 16MB, the default is 8MB).
The last one is a standard feature of ESPHOME/clearly documented on the site. The platformio options are also mentioned, but not clearly explained.
So, hereās the code (sorry for all the blabbering above, I felt like explaining myself a bit):
esphome:
name: "your project name"
platformio_options:
build_flags: "-DBOARD_HAS_PSRAM"
board_build.arduino.memory_type: qio_opi
esp32:
board: esp32-s3-devkitc-1
framework:
type: arduino
version: latest
flash_size: 16MB
Now in all fairness, Iām not sure if the 'version: latest" is needed. I noticed it in some of the posts around the internet, so decided to try it. And ESPHOME does trigger a warning indicating that this is not recommended. Having said that, the board works now, and I did not want to fumble with it any longer
Anyway, I ended up flashing this setup to the ESP using ESPHOME-web, and after that OTA can be used (and is working in my case).
As said, I hope someone finds this one day and helps them to solve there issue!
For those who find this topic because they were searching for ILI9xxx configs (in my case using a ST7796s 4" display (example here) with a XPT2046 controller, here are the remaining relevant parts of the yaml file:
spi:
miso_pin: GPIO12
clk_pin: GPIO13
mosi_pin: GPIO11
touchscreen:
platform: xpt2046
calibration_x_min: 190 #callibration following explanation ESPHOME
calibration_x_max: 3886
calibration_y_min: 3929
calibration_y_max: 261
id: my_touchscreen
cs_pin: 6
on_touch: #this part is just to output coordinates in the log, useful to check if its working and for calibration (detailed on ESPHOME site)
- lambda: |-
ESP_LOGI("cal", "x=%d, y=%d, x_raw=%d, y_raw=%0d",
id(my_touchscreen).x,
id(my_touchscreen).y,
id(my_touchscreen).x_raw,
id(my_touchscreen).y_raw
);
binary_sensor: #example of how one 'button' looks
- platform: touchscreen
name: R1C1
x_min: 30
x_max: 110
y_min: 40
y_max: 140
display:
- platform: ili9xxx
model: ST7796
reset_pin: GPIO4
cs_pin: GPIO10
dc_pin: GPIO5
rotation: 0
update_interval: 5s
lambda: |-
//content as explained in display component on ESPHOME site
it.printf(......);
So hope this helps someone, and if someone else finds a mistake somewhere, please do let me know Iām here to learn!