ESP32-S2 Embedded PSRAM

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
Andrew Mamohin
Normal user
Posts: 95
Joined: 12 Jun 2020, 08:30
Location: Belarus, Gomel
Contact:

ESP32-S2 Embedded PSRAM

#1 Post by Andrew Mamohin » 13 Mar 2023, 13:59

I have different ESP32-S2 boards. The difference can be seen with esptool. This is the difference in the availability of PSRAM.

Code: Select all

esptool.py v4.5.1
Serial port COM41
Connecting...
Detecting chip type... Unsupported detection protocol, switching and trying again...
Detecting chip type... ESP32-S2
Chip is ESP32-S2FH4 (revision v0.0)
Features: WiFi, Embedded Flash 4MB, No Embedded PSRAM, ADC and temperature sensor calibration in BLK2 of efuse V1

Code: Select all

esptool.py v4.5.1
Serial port COM41
Connecting...
Detecting chip type... Unsupported detection protocol, switching and trying again...
Detecting chip type... ESP32-S2
Chip is ESP32-S2FNR2 (revision v0.0)
Features: WiFi, Embedded Flash 4MB, Embedded PSRAM 2MB, ADC and temperature sensor calibration in BLK2 of efuse V2
The board on which the "Embedded PSRAM" works fine with all firmwares, including EspEasy. The board on which "No Embedded PSRAM" does not work anywhere. I even tried to flash the WEB-server example from arduino. It works on the board with PSRAM, but does not work without PSRAM.
I tried flashing LED on a board which "No Embedded PSRAM". Yes, it works. It seems that only WI-FI is not working

Unfortunately these boards don't have a hardware com port so I can't see the espeasy log. What can be done with such boards? Maybe you can fix EspEasy for use with such boards?
Andy.

User avatar
Ath
Normal user
Posts: 3386
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ESP32-S2 Embedded PSRAM

#2 Post by Ath » 13 Mar 2023, 14:52

Actually, ESPEasy should automatically take care of the with/without PSRAM configuration. For ESP32 that is already working as intended. I don't own an ESP32s2 board without PSRAM though, so I can't verify.
/Ton (PayPal.me)

User avatar
Andrew Mamohin
Normal user
Posts: 95
Joined: 12 Jun 2020, 08:30
Location: Belarus, Gomel
Contact:

Re: ESP32-S2 Embedded PSRAM

#3 Post by Andrew Mamohin » 13 Mar 2023, 15:20

Ath wrote: 13 Mar 2023, 14:52 I don't own an ESP32s2 board without PSRAM though, so I can't verify.
But I have such a board. My friend has 6 of these boards... :(
What to do? Is it possible to make firmware specifically for such a board? I would test this.
Andy.

User avatar
Ath
Normal user
Posts: 3386
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ESP32-S2 Embedded PSRAM

#4 Post by Ath » 13 Mar 2023, 15:27

Well, as said, it should work out of the box.

But if it won't even work with standard Arduino examples, then maybe something is broken in the Arduino libraries, that may need fixing first, before it can work with other firmwares.
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8607
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP32-S2 Embedded PSRAM

#5 Post by TD-er » 13 Mar 2023, 15:36

Let's move back one more step...
How is the USB connected to the ESP?
ESP32-S2 (and others which we don't yet support...) can be wired in 2 ways:
- Directly to USB, where the ESP does emulate an USB device
- External USB to UART chip, like the familiar CH340 and the 210x.

The one that needs to emulate an USB device, can only be flashed via this USB chip to ESPEasy once, as I don't (yet) support this serial port emulation.
See: https://github.com/letscontrolit/ESPEasy/issues/4493

User avatar
Andrew Mamohin
Normal user
Posts: 95
Joined: 12 Jun 2020, 08:30
Location: Belarus, Gomel
Contact:

Re: ESP32-S2 Embedded PSRAM

#6 Post by Andrew Mamohin » 13 Mar 2023, 16:00

TD-er wrote: 13 Mar 2023, 15:36 - Directly to USB, where the ESP does emulate an USB device
IMG_20230313_175456.jpg
IMG_20230313_175456.jpg (77.91 KiB) Viewed 9120 times
Here are the boards. It's strange, I already flashed them with different firmware, including just from the Arduino IDE, the LED blinked.
It seems that WIFI just does not work in any firmware.
My friend did the same with his boards.

I flash the boards directly through the USB-C. When I press the "0" button when the board is turned on, I get a COM-port.
Andy.

TD-er
Core team member
Posts: 8607
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP32-S2 Embedded PSRAM

#7 Post by TD-er » 13 Mar 2023, 16:10

If you have a sketch running which does not enable the USB emulation and the bootloader is erased, you might not be able to flash them with anything else via the USB port anymore.
The only way to get them to flash again is wiring up an USB to serial adapter to the pins of Serial0 and toggle the reset/GPIO-0 pin at power on.

I'm not 100% sure how these chips have the internal PSRAM wired.
It could be these boards have them wired to the same SPI bus as the (also internal) flash, which means there is probably some GPIO pin internally wired as CS for the PSRAM.
No idea which pin that might be and also no idea whether this pin is then wired on the outside too.
But maybe we should (in ESPEasy) specifically pull up or down some pin when enabling PSRAM on these boards?

I guess I should also order a few of these boards with PSRAM too when starting to implement support for the USB emulation as described in the issue I linked.

User avatar
Andrew Mamohin
Normal user
Posts: 95
Joined: 12 Jun 2020, 08:30
Location: Belarus, Gomel
Contact:

Re: ESP32-S2 Embedded PSRAM

#8 Post by Andrew Mamohin » 13 Mar 2023, 18:23

TD-er wrote: 13 Mar 2023, 16:10 I guess I should also order a few of these boards with PSRAM too when starting to implement support for the USB emulation as described in the issue I linked.
Problems occur when trying to use the boards without PSRAM. Тhe boards with PSRAM work fine.
But, when buying on Ali, you can randomly buy different boards.
Andy.

TD-er
Core team member
Posts: 8607
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP32-S2 Embedded PSRAM

#9 Post by TD-er » 07 Apr 2023, 12:44

I did order 5 with PSRAM and 5 without, all from the same seller....

Just received them, 10 pcs with PSRAM :(

So not sure whether I should feel "duped" as those with PSRAM are generally considered to be of "better value".

N.B. Added ToDo for testing boards without PSRAM added to this issue: https://github.com/letscontrolit/ESPEasy/issues/4493

TD-er
Core team member
Posts: 8607
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP32-S2 Embedded PSRAM

#10 Post by TD-er » 02 Jun 2023, 09:08

Could you please test with the latest build, to see if this is still an issue.
https://td-er.nl/ESPEasy/latest/

Sadly I don't have such an ESP32-S2 board without PSRAM.

N.B. the latest build now also supports the ESPEasy console via USBCDC.
It 'only' took about 2 weeks near full time to implement a complete rewrite of the ESPEasySerial part to support all USB type serial ports and make the 'console' capable of being connected to 2 serial ports at the same time so you have a proper default when initially flashing a unit.

User avatar
Andrew Mamohin
Normal user
Posts: 95
Joined: 12 Jun 2020, 08:30
Location: Belarus, Gomel
Contact:

Re: ESP32-S2 Embedded PSRAM

#11 Post by Andrew Mamohin » 02 Jun 2023, 09:25

TD-er wrote: 02 Jun 2023, 09:08 Could you please test with the latest build, to see if this is still an issue.
https://td-er.nl/ESPEasy/latest/
"Forbidden"
Andy.

TD-er
Core team member
Posts: 8607
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP32-S2 Embedded PSRAM

#12 Post by TD-er » 02 Jun 2023, 09:28

What is forbidden?
The webpage?
Can you DM me your IP-address?

TD-er
Core team member
Posts: 8607
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP32-S2 Embedded PSRAM

#13 Post by TD-er » 02 Jun 2023, 09:39

Based on the logs, I think I have your IP subnet now removed from the standard block list I have in my .htaccess
Even when having such an elaborate block list, my server gets to deal with a few TB per month in incoming data for blocked hack attempts... :(

User avatar
Andrew Mamohin
Normal user
Posts: 95
Joined: 12 Jun 2020, 08:30
Location: Belarus, Gomel
Contact:

Re: ESP32-S2 Embedded PSRAM

#14 Post by Andrew Mamohin » 02 Jun 2023, 10:19

Yes, we have access now. I have a static IP, so you can only allow it if you don't like other addresses from my network.
I flashed a new build! She works! Well done! Thank you!
I don't quite understand how COM port works. USB CDC is in the settings, the port opens, but there is no data there. But, I don't really need it.
Andy.

TD-er
Core team member
Posts: 8607
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP32-S2 Embedded PSRAM

#15 Post by TD-er » 02 Jun 2023, 10:25

The factory default settings are:
Tools->Advanced -> Serial Console Settings:
Enable Serial Port console: checked
Baud Rate: 115200
Serial Port: USB CDC (on ESP32-S2), on ESP32-S3/C3 this is USB HWCDC
Fallback to Serial 0: Checked


What this default does:
Enable serial console (showing logs, accepting commands)
Primary serial port for the console is then USB CDC
Secondary serial port is then HWSerial0, so it doesn't matter which board you have, either with an external USB to serial port or USB soldered directly to the ESP.

User avatar
Andrew Mamohin
Normal user
Posts: 95
Joined: 12 Jun 2020, 08:30
Location: Belarus, Gomel
Contact:

Re: ESP32-S2 Embedded PSRAM

#16 Post by Andrew Mamohin » 02 Jun 2023, 11:42

Yes, I restarted the board and the port worked!
Andy.

TD-er
Core team member
Posts: 8607
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP32-S2 Embedded PSRAM

#17 Post by TD-er » 02 Jun 2023, 11:58

Yep, the ESP32-S2 is a bit funky with its serial port stuff.

Now that I have added support for ESP32-C3 and S3, I am convinced the S2 is a bit of a strange intermediate product.
Like it was a new attempt to add new features, from which a lot was learned and then they made the S3.

On the other hand, the S3 is also a fine source of things to 'learn from' ;)
Especially the mess they made from the SPI bus requirements is rather frustrating as you have to have the exact SPI config (quad or octal for flash and/or PSRAM) or else things will simply not work.
See: https://espeasy.readthedocs.io/en/lates ... l-spi-mode

GalAl
New user
Posts: 2
Joined: 05 Jun 2023, 22:51

Re: ESP32-S2 Embedded PSRAM

#18 Post by GalAl » 06 Jun 2023, 12:53

TD-er wrote: 02 Jun 2023, 09:08 Could you please test with the latest build, to see if this is still an issue.
https://td-er.nl/ESPEasy/latest/

Sadly I don't have such an ESP32-S2 board without PSRAM.

N.B. the latest build now also supports the ESPEasy console via USBCDC.
I have ESP32-S2 board without PSRAM.
I tried the latest 20230601 firmware.
I receive data output to the COM port.
Unfortunately, no device can connect to the ESP32-S2 board via WiFI in AP mode for initial configuration.
I tried to connect using both a smartphone and a laptop. Connection fails.
Output to the COM port:

Code: Select all

697 : Info   :
INIT : Booting version: ESP_Easy_mega_20230601_collection_A_ESP32s2_4M316k_CDC,              (GitHub Actions) mega_4e426eb (ESP32 SDK 4.4.4.20230310)
699 : Info   : INIT : Free RAM:157452
700 : Info   : INIT : Manual Reboot #1 Last Action before Reboot: Background Tas             k Last systime: 0 - Restart Reason: CPU0: Vbat power on reset
701 : Info   : FS   : Mounting...
709 : Info   : FS   : Mount successful, used 141815 bytes of 290156
718 : Info   : CRC  : Settings CRC           ...OK
731 : Info   : ESPEasy console using ESPEasySerial
732 : Info   : ESPEasy console fallback enabled
737 : Info   : CRC  : SecuritySettings CRC   ...OK
751 : Info   : ESPEasy console using ESPEasySerial
752 : Info   : ESPEasy console fallback enabled
754 : Info   : INIT : Check for Priority tasks
758 : Info   : INIT : SPI not enabled
760 : Info   : Set Network mode: WiFi
862 : Info   : WIFI : Set WiFi to STA
923 : Info   : WiFi : Event STA Started
1025 : Info   : WiFi : Start network scan all channels
6845 : Info   : WiFi : Scan finished, found: 3
6847 : Info   : WiFi : Start network scan all channels
12666 : Info   : WiFi : Scan finished, found: 3
12668 : Info   : Setup: Scan all channels
12680 : Info   : ESPEasy console using ESPEasySerial
12681 : Info   : ESPEasy console fallback enabled
12682 : Info   : INIT : Free RAM:101556
12873 : Info   : ESPEasy console using ESPEasySerial
12874 : Info   : ESPEasy console fallback enabled
12875 : Info   : INFO : Plugins: 83 [Normal][Collection_A ESP32] (ESP32 SDK 4.4.4.20230310)
12877 : Error  : WIFI : No valid wifi settings
12878 : Info   : WiFi : WiFiConnected(), start AP
12980 : Info   : WIFI : Set WiFi to AP+STA
12984 : Info   : WiFi : Event AP Started
14132 : Info   : WiFi : Event AP Stopped
14134 : Info   : WiFi : Event AP Started
14137 : Info   : WIFI : AP Mode ssid will be Collection-A-ESP32 with address 192.168.4.1 ch: 1
14140 : Info   : WIFI : Arduino wifi status: WL_DISCONNECTED 6 ESPeasy internal wifi status: DISCONNECTED
14142 : Info   : Webserver: start
15483 : Info   : WD   : Uptime 0 ConnectFailures 0 FreeMem 89784 WiFiStatus WL_DISCONNECTED 6 ESPeasy internal wifi status: DISCONNECTED
45487 : Info   : WD   : Uptime 1 ConnectFailures 0 FreeMem 91752 WiFiStatus WL_DISCONNECTED 6 ESPeasy internal wifi status: DISCONNECTED
75489 : Info   : WD   : Uptime 1 ConnectFailures 0 FreeMem 91752 WiFiStatus WL_DISCONNECTED 6 ESPeasy internal wifi status: DISCONNECTED

TD-er
Core team member
Posts: 8607
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP32-S2 Embedded PSRAM

#19 Post by TD-er » 06 Jun 2023, 13:03

Can you enter the credentials for WiFi via the serial terminal?

Code: Select all

wifissid,<YourWiFiSSID>
wifikey,<YourWiFiPassword>
save
Of course with your credentials replaced

Maybe you also need to power cycle the unit afterwards, as the ESP32-S2 does some things a bit 'odd' and I noticed power cycle often 'fixes' those quirks.

Also I really "hate" those purple Wemos like S2 units as their WiFi antenna really is hit-or-miss.
I've got about 10 of those and some seem to work just fine and others act really really show on WiFi, but after a few minutes they suddenly respond just fine.

GalAl
New user
Posts: 2
Joined: 05 Jun 2023, 22:51

Re: ESP32-S2 Embedded PSRAM

#20 Post by GalAl » 06 Jun 2023, 14:01

TD-er wrote: 06 Jun 2023, 13:03 Can you enter the credentials for WiFi via the serial terminal?

Code: Select all

wifissid,<YourWiFiSSID>
wifikey,<YourWiFiPassword>
save
I entered these commands through serial terminal .
The board connected to my required WiFi AP and I got control to the web interface.
thanks

Code: Select all

9491 : Info   : WIFI : DHCP IP: 192.168.15.11 (Collection-A-ESP32) GW: 192.168.15.1 SN: 255.255.255.0 DNS: 195.88.1.3 / 0.0.0.0   duration: 432 ms
9513 : Info   : UDP : Start listening on port 8266
9524 : Info   : firstLoopConnectionsEstablished
10230 : Info   : WD   : Uptime 0 ConnectFailures 0 FreeMem 92656 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init
36318 : Info   : static_file: /favicon.ico
40230 : Info   : WD   : Uptime 1 ConnectFailures 0 FreeMem 88500 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init
46653 : Info   : static_file: /favicon.ico
70230 : Info   : WD   : Uptime 1 ConnectFailures 0 FreeMem 87956 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init
100230 : Info   : WD   : Uptime 2 ConnectFailures 0 FreeMem 87944 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init
130230 : Info   : WD   : Uptime 2 ConnectFailures 0 FreeMem 87944 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init
160230 : Info   : WD   : Uptime 3 ConnectFailures 0 FreeMem 88396 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init
190230 : Info   : WD   : Uptime 3 ConnectFailures 0 FreeMem 88880 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init
220230 : Info   : WD   : Uptime 4 ConnectFailures 0 FreeMem 88880 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init
250231 : Info   : WD   : Uptime 4 ConnectFailures 0 FreeMem 88880 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init
280230 : Info   : WD   : Uptime 5 ConnectFailures 0 FreeMem 88880 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init
310230 : Info   : WD   : Uptime 5 ConnectFailures 0 FreeMem 89008 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init
340230 : Info   : WD   : Uptime 6 ConnectFailures 0 FreeMem 89680 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init
370230 : Info   : WD   : Uptime 6 ConnectFailures 0 FreeMem 89680 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init
400230 : Info   : WD   : Uptime 7 ConnectFailures 0 FreeMem 89680 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init
430230 : Info   : WD   : Uptime 7 ConnectFailures 0 FreeMem 89680 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init
460231 : Info   : WD   : Uptime 8 ConnectFailures 0 FreeMem 89680 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init
490230 : Info   : WD   : Uptime 8 ConnectFailures 0 FreeMem 89680 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init

TD-er
Core team member
Posts: 8607
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP32-S2 Embedded PSRAM

#21 Post by TD-er » 06 Jun 2023, 14:39

The fact you couldn't connect to the ESP32-S2 while it had the AP mode on, might be an indication the ESP may not get a stable enough power. (or the USB cable isn't that good, or the USB connector may not make good contact)
So please keep that in mind when experiencing other issues in the future.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest