ESP32 Useful Information

Last Updated on 3. October 2026 by SuffocationLink status: OK

Der ESP32 ist der Nachfolger des erfolgreichen ESP8266 Controllers. Er besitzt eine 32Bit Tensilica Xtensa LX6 CPU in der Regel mit zwei Kernen (RISC Architektur). Hier sammle ich für mich interessante Informationen.

Areas of application

  • Household applications
  • Home automation
  • Smarte Steckdosen und Lichtsteuerung
  • WLAN Control
  • Baby monitor
  • IP cameras
  • Sensor networks
  • Wearables
  • Bluetooth Applikationen wie Kopfhörer/Lautsprecher …

Documentation

https://www.espressif.com/en/products/hardware/esp32/overviewLink status: Broken

https://github.com/espressif/arduino-esp32Link status: OK

Hardware

Packaging

Den ESP32 gibt es als Chip oder Modul mit zusätzlichem externem Speicher, Antennen u.ä.

Welche Versionen es aktuell gibt, ist der Espressif Bestellinformation zu entnehmen. Hier der Link zu ihr:

Link status: OKEspressif Order InformationLink status: OK

Designation

Jeder ESP kommt mit einer Beschriftung. Die einzelnen Chips sind mit einem Code versehen. Hier ein Beispiel:

Espressif Datenblatt – Bestellinformationen
Source: https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf

With the modules, the print is more of a reference to the respective data sheet or the Order informationLink status: OK.

There are also different versions of the chips and modules, which can also differ from each other.

inner workings

The following diagram shows the architecture of the controller.
In addition to various interfaces, it has:

  • Wi-Fi
  • Bluetooth
  • A temperature sensor
  • Crypto Routines
ESP32 block diagram

Storage

Der ESP kommt mit unterschiedlichen Speicherkonfigurationen daher, hier ein kurzer Überblick, welche Kombinationen aktuell möglich sind. Um welche Konfiguration es sich handelt, kann dem jeweiligen Datenblatt oder der Order InformationLink status: OK to be taken.

RAM

Der Ur-Esp32 hat einen 520KB internen Speicher, aber auch die Möglichkeit, diesen extern zu erweitern. Aktuell wird als externe Erweiterung nur PSRAM unterstützt. Es ist möglich, den Speicher auf bis zu 8MB zu erweitern, wobei aktuell nur 4 MB gleichzeitig adressiert werden können.

Flash

Je nach Konfiguration kommt der ESP im Chipformat mit 0, 2 oder 4 MB internem FLASH. Bei den Modulen kann der FLASH extern im Modul verbaut sein. Der Ur-ESP kann maximal 16 MB Flashspeicher adressieren. Je nachdem, wie der Flash Speicher gemappt ist und welche Art verwendet wird, kann unterschiedlich viel davon verwaltet werden.

  • QSPI Flash
    • Beim Mapping als Instructions Speicher können bis zu 11MB + 248KB adressiert werden. Bei mehr als 3 MB + 248 KB wird der Zugriff inperformant.
    • When mapping as read-only data storage, a maximum of 4MB can be addressed.
  • Externer SRam kann als CPU Datenspeicher gemappt werden und es werden bis zu 8MB unterstützt. Es kann aber nur auf 4MB gleichzeitig zugegriffen werden. (Beispiel OTA 2x 4MB Nutzbar)

ROM

Der UR-ESP hat 448 KB ROM. Sie beinhalten laut Espressif Forum spezielle interne Funktionen und zum Beispiel den Bluetooth Stack. Der extern nutzbare Funktionsumfang kann Git entnommen werden:

https://github.com/espressif/esp-idf/tree/master/components/esp32/include/romLink status: Broken

UART 1,2,3

Der Esp32 besitzt 3 UART Schnittstellen, die voneinander unabhängig konfiguriert werden können. Die Maximalgeschwindigkeit beträgt 5Mbps. Dies ermöglicht eine asynchrone Kommunikation mit RS232, RS485 und IrDa Unterstützung. Any GPIO pin can be used as a connection.. (Source: Espressif ESP32 DatasheetLink status: OK Page 28, 31)

Default pin assignment:

UARTRX IOTX IOCTSRTS
UART0GPIO3GPIO1N/AN/A
UART1GPIO9GPIO10GPIO6GPIO11
UART2GPIO16GPIO17GPIO8GPIO7
Source: https://circuits4you.com/2018/12/31/esp32-hardware-serial2-example/

In the Arduino GUI, the following settings are available:

  • Serial – Uart0 GPIO 1/3
  • Serial1 – Uart 1, GPIO 9/10 meist schon mit Flash Speicher belegt
  • Serial2 – Uart 2 GPIO 16/17

Die Ansteuerung ist in allen gängigen Frameworks wie Arduino IDE, Espressif, Micropython… enthalten.

I²C Wire Bus

The ESP32 has two Wire buses. Any GPIO pin can be chosen for the connection. Er kann mit einer Geschwindigkeit von 100Kbit’s (Standard Mode), 400Kbit’s (Fast Mode) bis hin zu 5 MHz arbeiten. Die beiden Busse beherrschen 7bit und 10 Bit Adressierung. (Quelle: Espressif ESP32 DatasheetLink status: OK Page 28,31)

Die Ansteuerung ist in allen gängigen Frameworks wie Arduino IDE, Espressif, Micropython… enthalten.

ADC's

Der ESP32 besitzt zwei getrennte ADC 12Bit Register mit insgesamt 18 Kanälen. Durch die 12 Bit ergibt sich eine Messspanne von 0 bis 4095.

ADC1 hat 8 Kanäle, diese sind an den GPIOs 32-39 verfügbar.

ADC2 besitzt 10 Kanäle und ist mit den GPIOs  0, 2, 4, 12 – 15 und 25 – 27 verbunden. Weiterhin ist der ADC2 nicht nutzbar, wenn WIFI verwendet wird.

GPIOADCChannelNote
3610
3711
3812
3913
3214
3315
3416
3517
420
021Most often assigned to boot options
222
1523
1324
1225
1426
2727
2528
2429
ADC assignment to GPIOs

Further information can be found in the article linked below from Espressif.

Programming environment

Arduino GUI

Platformio

Platform IOLink status: OK

Espressif IDF

VS Code for Espressif IDF

VS-Code Espressif IDFLink status: OK

Spannung am ESP abfragen

Der ESP 8266 hat noch die Möglichkeit, die Spannung zu messen. Beim ESP32 benötigt man eine Hilfsschaltung, ein Spannungsteiler mit 100kOhm und 10kOhm am ADC.

Mehr Infos gibt’s in dem gelinkten Beitrag:

https://www.arduinoforum.de/arduino-Thread-ESP32-BatteriestatusLink status: Broken

Formel zur Spannungsberechnung

Uin =  (100 + 10) / 10 ((R1 + R2) /R2) 

https://www.arduinoforum.de/arduino-Thread-ESP32-Batteriestatus

Software Tipps

Read hardware data

Die Datei esp.h/Klasse ESP bietet Zugriff auf einige Informationen der Hardware. Wie Id, Versionen, freier Speicher usw.. Der komplette Funktionsumfang kann in GitHub eingesehen werden.

https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/Esp.hLink status: OK

Eingebunden werden muss die Esp.h meist nicht, diese ist bei den Standardbibliotheken mit dabei. (Danke für den Hinweis an Andreas, siehe Kommentar). Folgend ein paar Beispiele aus der Datei.

Trigger restart

Eine Funktion ist das Neustarten des ESPs. Dies kann nach einem remote Update der Firmware nötig sein oder bei schlampiger Programmierung, wenn der Speicher voll ist ;).

ESP.restart();

Query storage information

Gerade für das Debuggen sind Speicherinformationen ganz nützlich. Zum Beispiel kann hieran erkannt werden, ob verwendeter Speicher auch wieder freigegeben wird. Die folgenden Funktionen können hierfür aufgerufen werden:

Heap/SPI memory size

uint32_t var = ESP.getHeapSize();
uint32_t var2 = ESP.getPsramSize();

Free Heap/PS Memory

uint32_t var1 = ESP.getFreeHeap();
uint32_t var2 = ESP.getFreePsram();

Minimalwert des Heap/SPI Speichers seit Controllerstart.

uint32_t var1 = ESP.getMinFreeHeap(); 
uint32_t var2 = ESP.getMinFreePsram();

Maximum block size of the heap/SPI memory

uint32_t var1 = ESP.getMaxAllocHeap();
uint32_t var2 = ESP.getMaxAllocPsram();

Basic OTA

OTA – Over The Air – Protokolle ermöglichen es, Microcontroller über das Netzwerk zu flashen. Da der ESP32 über WLAN verfügt, ist ein Flashen über das Netz möglich. Die ausführliche Anleitung kann unter folgendem Link gefunden werden:

Instructions for OTALink status: OK

Basically, the procedure is as follows:

  • Install Python
  • Select Example Project Basic OTA
  • Enter Wi-Fi data
  • Flash OTA firmware
  • OTA-Teil in eigenen Code einbauen und immer über das Netzwerk flashen

Problems

WiFi verbindet sich nur jedes 2. Mal

To start the connection as follows:

  WiFi.disconnect();
  WiFi.mode(WIFI_STA); // can also be another mode
  while (WiFi.status() != WL_CONNECTED) {
    WiFi.begin(SSID, PASSWORD);
    delay(1000);
  }

Speicher voll / zu klein

Gerade bei Graphiken oder bei der Bluetooth Bibliothek gerät man schnell mal an die Grenzen des verfügbaren Programmspeichers.

Ein gutes Einführungsvideo gibt’s von Andreas Spiess:

Youtube Andreas Spiess – More Memory for the ESP32 …Link status: OK

Im Grunde geht es darum, die Speicherzuordnung richtig einzustellen. Um mehr Speicher für die Applikationen zu bekommen, kann OTA ausgeschaltet oder der SPIFFS Speicher vermindert werden.

Arduino GUI

In der Arduino Gui sind die Einstellungen im Menü Werkzeuge zu finden.

Arduino Gui – Einstellungen zum Speicher

Anyone needing additional options can add them in the XML configuration.

Espressif-IDF

In der Espressif-IDF können die Einstellungen über die Menuconfig und über eine eigene Partitionstabelle vorgenommen werden.

Espressif IDF – Menuconfig, Hauptmenü
Espressif-IDF – Anpassen der Speichergröße und der Autodetectoption
Espressif-IDF – Anpassen der Partitionstabelle
Espressif-IDF – Partitionstabelle im Projektverzeichnis

Related Posts

ESP WEB Serial LibraryLink status: Unknown
ESP32-C3 Seeed Studio XIAOLink status: Unknown
ESP32-C3 Super Mini BoardLink status: Unknown
Preview – LuatOs ESP32-C3 BoardLink status: Unknown
ESP32 Bluetooth GamepadLink status: Unknown
ESP01 Relay BoardsLink status: Unknown
ESP8266/32 WiFi Manager.Link status: Unknown

Sources

https://en.wikipedia.org/wiki/ESP32Link status: OK

https://www.espressif.com/en/products/hardware/esp32/overviewLink status: Broken

https://github.com/espressif/arduino-esp32Link status: OK

ESP Wroom 32 IO ReferenceLink status: OK

Espressif's Contribution to the ADCLink status: OK

Instructions for OTALink status: OK

Youtube Andreas Spiess – More Memory for the ESP32 …Link status: OK

ThingPulse's contribution to PSRamLink status: OK

Espressif Order InformationLink status: OK

https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdfLink status: OK

DateChangeAuthor
03.10.2026Rechtschreibung korrigiert: Tippfehler, Kommas, Groß-/Kleinschreibung, Grammatik
Log-Liste eingefügt
Suffocation
19.06.2018Post createdSuffocation
Changelog

10 thoughts on “ESP32 Nützliche Infos”

  1. Please review, that doesn't make much sense.

    QSPI Flash
    When mapping as instruction memory, up to 11MB + 248KB can be addressed. With more than 3MB + 248KB, access becomes ineffectual.

    Kind regards, Mike

    1. Hello Mike

      is from the ESP32 datasheet:

      https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf

      Page 26, if I understood something incorrectly, please correct me.

      3.1.3 External Flash and RAM ESP32 supports multiple external QSPI flash and external RAM (SRAM) chips.

      More details can be found in ESP32 Technical Reference Manual > Chapter SPI Controller. ESP32 also supports hardware
      Encryption/decryption based on AES to protect developers’ programs and data in flash.

      The ESP32 can access external QSPI flash and SRAM through high-speed caches.
      • Up to 16 MB of external flash can be mapped into CPU instruction memory space and read-only memory
      space simultaneously.
      – When external flash is mapped into CPU instruction memory space, up to 11 MB + 248 KB can be
      mapped at a time. Note that if more than 3 MB + 248 KB are mapped, cache performance will be
      reduced due to speculative reads by the CPU.
      – When external flash is mapped into read-only data memory space, up to 4 MB can be mapped at a
      Time. 8-bit, 16-bit and 32-bit reads are supported.
      • External RAM can be mapped into the CPU's data memory space. SRAM up to 8 MB is supported, and up to 4
      MB can be mapped at a time. 8-bit, 16-bit and 32-bit reads and writes are supported.

      Shame on me, this source was missing from the post, I have now added it.

      Hello
      Stefan

  2. Hello Stefan!
    Thank you for the informative website. Perhaps you can help me?
    I am using the ESP32 cam for an intercom system and am having the problem that the camera can no longer be accessed after a few days (http://http://192.168.X.X/captureThe problem is fixed via the reset button, but that isn't a solution. Is there an HTTP command that can trigger such a reset? Everything runs via IOBroker for me, which allows such commands to be sent via script at any time.
    SG tom

    1. Hi Tom,

      Thank you for your contribution. As far as I know, there isn't a command via HTML that calls ESP.restart(). However, it should be possible to implement the command in the existing format within the ESP cam.

      In the file app_httpd.cpp of the Cam Webserver, from approximately line 491 (If cascade), insert another If condition:

      else if (!strcmp(variable, „reset“)) { ESP.restart();}

      and then via HTTP with

      http:///control?var=reset&val=1

      call. Theoretically, it should work like this, although I haven't tried it 😉
      More on the ESP Cam here: https://www.fambach.net/esp32-cam-modul/your-ip

      1. Hi Joe!
        Thank you very much for the tip. When I have to remove the camera again, I'll solder the electrolytic capacitor on. At the moment, I'm monitoring the camera's fixed IP. If it no longer appears on the network, its power supply will be interrupted for 10 seconds. In that case, this is the simplest and quickest solution.

  3. Hello Stefan
    Thank you for the interesting tips.
    First, I included Esp.h in the library and started the sketch with #include #.
    The various hardware details could be displayed.
    When I commented out the include, the display still appeared. How can I explain this to myself?
    2. Question: You've displayed the instruction „ESP.restart()“ so prominently; it works but I can't think of a practical application for it. When would you need this?
    Andreas

    1. Hello Andreas,
      Thank you for your comment. Esp.h is included by default with the board drivers and does not need to be included separately. I only listed it so that the functionalities it offers can be found in Git.
      To be honest, I have to confess that I opened the page with the intention of gathering several useful pieces of information here, but unfortunately, that's all it amounted to :(. This is also because new boards are constantly being released that I want to test.
      What I find important is the function for example for:

    2. Sloppily programmed, restart the ESP once a day 😉
    3. For OTA (Over the Air) firmware updates, update firmware and restart, or install after restart.

      Greetings Stefan

      P.S. I've expanded the post regarding this.

  4. Hello Stefan, thank you for your carefully crafted and informative blog.
    First, a quick note on a typo ;-).
    Software Tips.
    Then I was disappointed that you haven't yet got to grips with something better than the Arduino IDE. For me, as a long-standing (> 40 years) electronics and software developer, this IDE is just horrific.
    Attempting to integrate the Arduino environment into more professional tools has previously been associated with some hurdles and wasn't really successful.
    Have you looked into the new Eclipse 2019 yet? Dealing with multiple projects here has its pitfalls.
    Kind regards, Manfred

    1. Hello Manfred,

      Thanks for your comment and the tip ;)(I've changed it).
      It's true, the Arduino IDE is really only for simple applications. However, since I only dabble with it sporadically, it's sufficient for now. Its advantage is that it still works after updates. I tried Sloeber for Eclipse; the plugin is actually brilliant, but it repeatedly caused me problems with library resolution. For a while, I also worked with PlatformIO; this IDE is also quite decent, until it stopped working after updates. I haven't tried Eclipse 2019 yet, which would probably be something for my next holiday 🙂

      Hello
      Stefan

Leave a Reply

Your email address will not be published. Required fields are marked *