-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Doc update: Troubleshooting + SD libs #8241
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
Changes from 15 commits
bb87561
b8bae5f
9c80ac9
7bb3c70
ade1265
8b8b8c2
0937ed0
e2468bd
7ae2c68
0da7104
270cf97
550282c
fa8b1e0
825c50d
dc5fc60
11d3285
8c8ab68
b7ef411
c36edf3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,7 @@ Solution | |
To avoid this error, you can install the ``python-is-python3`` package to create the symbolic links. | ||
|
||
.. code-block:: bash | ||
|
||
sudo apt install python-is-python3 | ||
|
||
If you are not using Ubuntu, you can check if you have the Python correctly installed or the presence of the symbolic links/environment variables. | ||
|
@@ -44,7 +44,7 @@ Flashing | |
Why is my board not flashing/uploading when I try to upload my sketch? | ||
********************************************************************** | ||
|
||
To be able to upload the sketch via serial interface, the ESP32 must be in the download mode. The download mode allows you to upload the sketch over the serial port and to get into it, you need to keep the **GPIO0** in LOW while a resetting (**EN** pin) cycle. | ||
To be able to upload the sketch via the serial interface, the ESP32 must be in the download mode. The download mode allows you to upload the sketch over the serial port, and to get into it, you need to keep the **GPIO0** in LOW while resetting (**EN** pin) the cycle. | ||
If you are trying to upload a new sketch and your board is not responding, there are some possible reasons. | ||
|
||
Possible fatal error message from the Arduino IDE: | ||
|
@@ -54,23 +54,27 @@ Possible fatal error message from the Arduino IDE: | |
Solution | ||
^^^^^^^^ | ||
|
||
Here are some steps that you can try to: | ||
Here are some steps that you can try: | ||
|
||
* Check your USB cable and try a new one. | ||
* Change the USB port. | ||
* Check your USB cable and try a new one (some cables are only for charging and there is no data connection). | ||
* Change the USB port - prefer direct connection to the computer and avoid USB hubs. Some USB ports may share the power source with other ports used, for example, for charging a phone. | ||
* Check your power supply. | ||
* Make sure that nothing is connected to pins labeled **TX** and **RX**. | ||
* In some instances, you must keep **GPIO0** LOW during the uploading process via the serial interface. | ||
* Hold down the **“BOOT”** button in your ESP32 board while uploading/flashing. | ||
* Hold down the **“BOOT”** button on your ESP32 board while uploading/flashing. | ||
* Solder a **10uF** capacitor in parallel with **RST** and **GND**. | ||
* If you bought your dev board from a questionable seller, they might have scammed you and sent ESP8266 instead of ESP32. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this is relevant or should be mentioned in this document. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do you mean only the last one, or the capacitor too? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean the sentence about questionable sellers. This must be removed. |
||
* If you are using external power connected to pins, it is easy to confuse pins **CMD** (which is usually next to the 5V pin) and **GND**. | ||
|
||
In some development boards, you can try adding the reset delay circuit, as described in the *Power-on Sequence* section on the `ESP32 Hardware Design Guidelines <https://www.espressif.com/sites/default/files/documentation/esp32_hardware_design_guidelines_en.pdf>`_ in order to get into the download mode automatically. | ||
In some development boards, you can try adding the reset delay circuit, as described in the *Power-on Sequence* section on the `ESP32 Hardware Design Guidelines <https://www.espressif.com/sites/default/files/documentation/esp32_hardware_design_guidelines_en.pdf>`_ to get into the download mode automatically. | ||
|
||
Hardware | ||
-------- | ||
|
||
Why is my computer not detecting my board? | ||
************************************************** | ||
****************************************** | ||
|
||
If your board is not being detected after connecting to the USB, you can try to: | ||
If your board is not being detected after connecting to the USB, you can try the following: | ||
|
||
Solution | ||
^^^^^^^^ | ||
|
@@ -87,8 +91,8 @@ Wi-Fi | |
Why does the board not connect to WEP/WPA-"encrypted" Wi-Fi? | ||
************************************************************ | ||
|
||
Please note that WEP/WPA has significant security vulnerabilities and its use is strongly discouraged. | ||
The support may therefore be removed in the future. Please migrate to WPA2 or newer. | ||
Please note that WEP/WPA has significant security vulnerabilities, and its use is strongly discouraged. | ||
The support may, therefore, be removed in the future. Please migrate to WPA2 or newer. | ||
|
||
Solution | ||
^^^^^^^^ | ||
|
@@ -104,7 +108,7 @@ Nevertheless, it may be necessary to connect to insecure networks. To do this, t | |
Why does the board not connect to WPA3-encrypted Wi-Fi? | ||
******************************************************* | ||
|
||
WPA3 support is resource intensive and may not be compiled into the used SDK. | ||
WPA3 support is resource-intensive and may not be compiled into the used SDK. | ||
|
||
Solution | ||
^^^^^^^^ | ||
|
@@ -119,3 +123,120 @@ Sample code to check SDK WPA3 support at compile time: | |
#ifndef CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE | ||
#warning "No WPA3 support." | ||
#endif | ||
|
||
SPIFFS mount failed | ||
------------------- | ||
When you come across an error like this: | ||
|
||
.. code-block:: shell | ||
|
||
E (588) SPIFFS: mount failed, -10025 | ||
[E][SPIFFS.cpp:47] begin(): Mounting SPIFFS failed! Error: -1 | ||
|
||
Try enforcing format on fail in your code by adding ``true`` in the ``begin`` method such as this: | ||
|
||
.. code-block:: c++ | ||
|
||
SPIFFS.begin(true); | ||
|
||
See the method prototype for reference: ``bool begin(bool formatOnFail=false, const char * basePath="/spiffs", uint8_t maxOpenFiles=10, const char * partitionLabel=NULL);`` | ||
|
||
SD card mount fail | ||
------------------ | ||
Even though you made sure that the pins are correctly connected, and not using restricted pins, you may still get an error such as this: | ||
|
||
.. code-block:: shell | ||
|
||
[ 1065][E][sd_diskio.cpp:807] sdcard_mount(): f_mount failed: (3) The physical drive cannot work | ||
|
||
Most of the problems originate from a poor connection caused by Dupont cables, and one of the best solutions is to **solder all the connections** or use good quality connectors. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dupont cables -> prototyping cables/wires |
||
|
||
Note that with SD_MMC lib all the data pins need to be pulled up with an external 10k to 3.3V. This applies especially to card's D3 which needs to be pulled up even when using 1-bit line connection and the D3 is not used. | ||
|
||
If you want to try the software approach before soldering, try manually specifying SPI pins, like this: | ||
|
||
.. code-block:: c++ | ||
|
||
int SD_CS_PIN = 19; | ||
SPI.begin(18, 36, 26, SD_CS_PIN); | ||
SPI.setDataMode(SPI_MODE0); | ||
SD.begin(SD_CS_PIN); | ||
|
||
|
||
ESP32-S3 is rebooting even with a bare minimum sketch | ||
***************************************************** | ||
Some ESP32-S3 boards are equipped with Quad SPI (QSPI) or Octal SPI (OPI) PSRAM. If you upload such a board with default settings for ESP32-S3, it will result in rebooting with a message similar to this: | ||
|
||
https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-guides/flash_psram_config.html | ||
|
||
.. code-block:: bash | ||
|
||
E (124) esp_core_dump_flash: Core dump flash config is corrupted! CRC=0x7bd5c66f instead of 0x0 | ||
Rebooting... | ||
⸮⸮⸮ESP-ROM:esp32s3-20210327 | ||
Build:Mar 27 2021 | ||
rst:0xc (RTC_SW_CPU_RST),boot:0x18 (SPI_FAST_FLASH_BOOT) | ||
Saved PC:0x40376af0 | ||
SPIWP:0xee | ||
Octal Flash Mode Enabled | ||
For OPI Flash, Use Default Flash Boot Mode | ||
mode:SLOW_RD, clock div:1 | ||
load:0x3fce3808,len:0x44c | ||
load:0x403c9700,len:0xbec | ||
load:0x403cc700,len:0x2920 | ||
entry 0x403c98d8 | ||
|
||
assert failed: do_core_init startup.c:326 (flash_ret == ESP_OK) | ||
|
||
|
||
To fix the issue, you will need to find out the precise module you are using and set **PSRAM** in the Arduino IDE Tools according to the following table. | ||
|
||
How to determine the module version: | ||
------------------------------------ | ||
|
||
* First determine if you have a `WROOM-1 <https://www.espressif.com/sites/default/files/documentation/esp32-s3-wroom-1_wroom-1u_datasheet_en.pdf>`_ or `WROOM-2 <https://www.espressif.com/sites/default/files/documentation/esp32-s3-wroom-2_datasheet_en.pdf>`_ module - this is written on the module shielding almost at the top, right under the ESP logo and company name (Espresif) right after the ESP32-S3 - for example ESP32-S3-WROOM-2. | ||
* Then locate the version code on left bottom corner on the module shielding. The markings are very small and it might be really difficult to read with naked eyes - try using a camera with careful lighting. | ||
|
||
With this knowledge find your module in the table and note what is written in the **PSRAM** column. | ||
|
||
- If the results is empty (-) you don't need to change anything | ||
- For QSPI go to Tools > PSRAM > QSPI PSRAM | ||
- For OPI go to Tools > PSRAM > OPI PSRAM | ||
|
||
Note that WROOM-2 has always OPI. | ||
|
||
+---------+--------+------------+-------+ | ||
| Module | Code | Flash Mode | PSRAM | | ||
+=========+========+============+=======+ | ||
| WROOM-1 | N4 | QSPI | - | | ||
+---------+--------+------------+-------+ | ||
| WROOM-1 | N8 | QSPI | - | | ||
+---------+--------+------------+-------+ | ||
| WROOM-1 | N16 | QSPI | - | | ||
+---------+--------+------------+-------+ | ||
| WROOM-1 | H4 | QSPI | - | | ||
+---------+--------+------------+-------+ | ||
| WROOM-1 | N4R2 | QSPI | QSPI | | ||
+---------+--------+------------+-------+ | ||
| WROOM-1 | N8R2 | QSPI | QSPI | | ||
+---------+--------+------------+-------+ | ||
| WROOM-1 | N16R2 | QSPI | QSPI | | ||
+---------+--------+------------+-------+ | ||
| WROOM-1 | N4R8 | QSPI | OPI | | ||
+---------+--------+------------+-------+ | ||
| WROOM-1 | N8R8 | QSPI | OPI | | ||
+---------+--------+------------+-------+ | ||
| WROOM-1 | N16R8 | QSPI | OPI | | ||
+---------+--------+------------+-------+ | ||
| WROOM-2 | N16R8V | OPI | OPI | | ||
+---------+--------+------------+-------+ | ||
| WROOM-2 | N16R8V | OPI | OPI | | ||
+---------+--------+------------+-------+ | ||
| WROOM-2 | N32R8V | OPI | OPI | | ||
+---------+--------+------------+-------+ | ||
|
||
|
||
Further Help | ||
------------ | ||
|
||
If you encounter any other issues or need further assistance, please consult the `ESP32 Arduino Core <https://github.com/espressif/arduino-esp32>`_ documentation or seek help from the `ESP32 community forums <https://esp32.com>`_. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,52 @@ | ||
|
||
# SD library | ||
|
||
This library provides the integration of ESP32 and SD (Secure Digital) cards without additional modules. | ||
|
||
This library provides the integration of ESP32 and SD (Secure Digital) and MMC (Multi Media Card) cards without additional modules. This library is using SPI to interface with the cards. Please not that SPI mode is slower than the intended SD or MMC mode, however, provides more flexibility as the SPI module is available on all ESP SoCs and can be routed to any GPIO through GPIO matrix. | ||
PilnyTomas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Sample wiring diagram: | ||
|
||
 | ||
|
||
 | ||
|
||
For others SD formats: | ||
|
||
For other SD formats: | ||
|
||
 | ||
|
||
|
||
Image source: [Wikipedia](https://upload.wikimedia.org/wikipedia/commons/thumb/a/ab/MMC-SD-miniSD-microSD-Color-Numbers-Names.gif/330px-MMC-SD-miniSD-microSD-Color-Numbers-Names.gif) | ||
|
||
```diff | ||
- Warning: Some ESP32 modules have different pinouts! | ||
``` | ||
> **Warning** | ||
Some ESP32 modules have different pin outs! | ||
|
||
## Default SPI pins: | ||
Note that SPI pins can be configured by using `SPI.begin(sck, miso, mosi, cs);` alternatively you can change only the CS pin with `SD.begin(CSpin)` | ||
|
||
+--------------+---------+-------+----------+----------+----------+ | ||
| SPI Pin Name | ESP8266 | ESP32 | ESP32-S2 | ESP32-C3 | ESP32-S3 | | ||
+==============+=========+=======+==========+==========+==========+ | ||
| CS (SS) | GPIO15 | GPIO5 | GPIO5 | GPIO13 | GPIO13 | | ||
+--------------+---------+-------+----------+----------+----------+ | ||
| DI (MOSI) | GPIO13 | GPIO23| GPIO24 | GPIO14 | GPIO14 | | ||
+--------------+---------+-------+----------+----------+----------+ | ||
| DO (MISO) | GPIO12 | GPIO19| GPIO25 | GPIO15 | GPIO15 | | ||
+--------------+---------+-------+----------+----------+----------+ | ||
| SCK (SCLK) | GPIO14 | GPIO18| GPIO19 | GPIO16 | GPIO16 | | ||
+--------------+---------+-------+----------+----------+----------+ | ||
|
||
## FAQ: | ||
|
||
**Do I need any additional modules, like Arduino SD module?** | ||
**Do I need any additional modules**, like **the **Arduino**** SD module**?** | ||
|
||
No, just wire your SD card directly to ESP32. | ||
|
||
Tip: If you are using a microSD card and have a spare adapter to full-sized SD, you can solder Dupont pins on the adapter. | ||
|
||
|
||
**What is the difference between SD and SD_MMC libraries?** | ||
|
||
SD runs on SPI, and SD_MMC uses the SDMMC hardware bus on the ESP32. | ||
|
||
|
||
|
||
**Can I change the CS pin?** | ||
|
||
Yes, just use: `SD.begin(CSpin)` | ||
The SPI uses 4 communication pins + 2 power connections and operates on up to 80MHz. The SPI option offers flexibility on pin connection because the data connections can be routed through GPIO matrix to any data pin. | ||
SD-SPI speed is approximately half of the SD-MMC even when used on 1-bit line. | ||
You can read more about SD SPI in the [documentation](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/sdspi_host.html) | ||
|
||
SD_MMC is supported only by ESP32 and ESP320S3 and can be connected only to dedicated pins. SD_MMC allows to use of 1, 4 or 8 data pins + 2 additional communication pins and 2 power pins. The data pins need to be pulled up externally. | ||
PilnyTomas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
You can read more about SD_MMC in the [documentation](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/sdmmc_host.html) | ||
1-bit: SD_MMC_ speed is approximately two-times faster than SPI mode | ||
4-bit: SD_MMC speed is approximately three-times faster than SPI mode. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please mention checking the pin layout table in order to make sure the GPIOs numbers are.