13. Add hardware partition configuration option in Arduino IDE
The flash memory of the ESP32 board has 16M, and the range of the storage address expressed in hexadecimal is: 0x0-0x01000000.
This is the partition table that has been configured by the system, as shown in the figure below:
The storage location of this partition table file on the computer:
C:\Users\{YourUserName}\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\tools\partitions\large_spiffs_16MB.csv
It can be seen from the above partition table: APP0 area and APP1 area are 4.5M each; the data area is SPIFFS, the size is 6.9M.
But in the Arduino IDE, this configuration is not included in the hardware partition configuration options of the ESP32 Dev Module:
We need to add this configuration to the ESP32 Dev Module.
Open the development board configuration file:
C:\Users\{YourUserName}\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\boards.txt
Locate the name of the development board: esp32.name=ESP32 Dev Module, as shown in the figure below:
The last line of the ESP32 Dev Module partition configuration in this configuration file is:
1
esp32.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728
Copied!
Add the following 3 lines of code below this line:
1
esp32.menu.PartitionScheme.large_spiffs=Biboard V0(4.5 MB APP with OTA /6.9 MB SPIFFS)
2
esp32.menu.PartitionScheme.large_spiffs.build.partitions=large_spiffs_16MB
3
esp32.menu.PartitionScheme.large_spiffs.upload.maximum_size=4685824
Copied!
The following explains the meaning of the three lines of code:
1
esp32.menu.PartitionScheme.large_spiffs=Biboard V0(4.5 MB APP with OTA /6.9 MB SPIFFS)
Copied!
The name of the ESP32 partition configuration, we named it Biboard V0 (4.5M APP with OTA /6.9 MB SPIFFS), or it can be replaced with other names you are familiar with.
1
esp32.menu.PartitionScheme.large_spiffs.build.partitions=large_spiffs_16MB
Copied!
The partition configuration file information is the file large_spiffs_16MB.csv . You can also write a partition file to adjust the file size of the APP and data area.
1
esp32.menu.PartitionScheme.large_spiffs.upload.maximum_size=4685824
Copied!
This line of code specifies that the maximum upload program size is 4685824 bytes.
Let's try to compile a simple program to test whether the above configuration is set successfully.
Reopen the Arduino IDE, we can see the Biboard just configured:
After compiling the program, the result is as shown in the figure below:
Compilation is complete, using 213KB of Flash (4%), and the maximum usable size is 4,685,824 bytes.
In this passage,“4685824 bytes” is specified in the third line of code just added to the configuration file.
So far you have completed the configuration of the development board with the largest flash memory space in Arduino IDE.
Last modified 4mo ago
Export as PDF
Copy link