[ESP32 MAX] Configuration for ESP32 with 16MB Flash

This commit is contained in:
Ton Huisman
2021-03-05 21:52:55 +01:00
parent aef8f4d9b1
commit 10d07c2376
7 changed files with 136 additions and 10 deletions
+7
View File
@@ -0,0 +1,7 @@
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 0x400000,
app1, app, ota_1, 0x410000,0x400000,
eeprom, data, 0x99, 0x810000,0x1000,
spiffs, data, spiffs, 0x811000,0x7eF000,
1 # Name Type SubType Offset Size Flags
2 nvs data nvs 0x9000 0x5000
3 otadata data ota 0xe000 0x2000
4 app0 app ota_0 0x10000 0x400000
5 app1 app ota_1 0x410000 0x400000
6 eeprom data 0x99 0x810000 0x1000
7 spiffs data spiffs 0x811000 0x7eF000
+19
View File
@@ -134,3 +134,22 @@ build_flags = ${env:test_ESP32_4M316k.build_flags} -DHAS_ETHERNET
extends = env:test_ESP32-wrover-kit_4M316k
platform = ${env:test_ESP32-wrover-kit_4M316k.platform}
build_flags = ${env:test_ESP32-wrover-kit_4M316k.build_flags} -DHAS_ETHERNET
; A Lolin D32 PRO with 16MB Flash, allowing 4MB sketch size, and the rest (nearly 8MB) assigned to file storage
[env:max_ESP32_16M8124k]
extends = esp32_common
lib_ignore = ESP8266WiFi, ESP8266Ping, ESP8266WebServer, ESP8266HTTPUpdateServer, ESP8266mDNS, ESPEasy_ESP8266Ping, ESP32_ping
platform = ${esp32_common.platform}
board_build.partitions = esp32_partition_app4096k_spiffs8124k.csv
build_flags = ${esp32_common.build_flags}
-DFEATURE_ARDUINO_OTA
-DPLUGIN_BUILD_MAX_ESP32
board = lolin_d32_pro
extra_scripts = ${esp32_common.extra_scripts}
; If you have a board with Ethernet integrated and 16MB Flash, then this configuration could be enabled, it's based on the max_ESP32_16M8124k definition
[env:max_ESP32_16M8124k_ETH]
extends = env:max_ESP32_16M8124k
platform = ${env:max_ESP32_16M8124k.platform}
build_flags = ${env:max_ESP32_16M8124k.build_flags} -DHAS_ETHERNET
+4
View File
@@ -113,7 +113,11 @@ namespace std
#include <rom/rtc.h>
#include "esp_wifi.h" // Needed to call ESP-IDF functions like esp_wifi_....
#define PIN_D_MAX 39
#ifdef PLUGIN_BUILD_MAX_ESP32
#define MAX_SKETCH_SIZE 4194304 // 0x400000 look at partitions in csv file
#else // PLUGIN_BUILD_MAX_ESP32
#define MAX_SKETCH_SIZE 1900544 // 0x1d0000 look at partitions in csv file
#endif // PLUGIN_BUILD_MAX_ESP32
#endif
#include <WiFiUdp.h>
+4
View File
@@ -72,7 +72,11 @@
# define DEVICES_MAX 95
#else // if defined(PLUGIN_BUILD_TESTING) || defined(PLUGIN_BUILD_DEV)
# ifdef ESP32
# ifdef PLUGIN_BUILD_MAX_ESP32
# define DEVICES_MAX 125
# else // ifdef PLUGIN_BUILD_MAX_ESP32
# define DEVICES_MAX 100
# endif // ifdef PLUGIN_BUILD_MAX_ESP32
# else // ifdef ESP32
# define DEVICES_MAX 60
# endif // ifdef ESP32
+97 -8
View File
@@ -588,6 +588,24 @@ To create/register a plugin, you have to :
// TODO : Check compatibility of plugins for ESP32 board.
#endif
#ifdef PLUGIN_BUILD_MAX_ESP32
#define PLUGIN_DESCR "MAX ESP32"
#ifndef ESP32
#define ESP32
#endif
#ifdef ESP8266
#undef ESP8266
#endif
#define PLUGIN_SET_MAX
#define CONTROLLER_SET_ALL
#define NOTIFIER_SET_ALL
// See also PLUGIN_SET_MAX section at end, to include any disabled plugins from other definitions
// See also PLUGIN_SET_TEST_ESP32 section at end,
// where incompatible plugins will be disabled.
// TODO : Check compatibility of plugins for ESP32 board.
#endif
// Generic ------------------------------------
#ifdef PLUGIN_SET_GENERIC_1M
@@ -761,6 +779,19 @@ To create/register a plugin, you have to :
#endif
#endif
// MAX ###########################################
#ifdef PLUGIN_SET_MAX
#ifndef PLUGIN_SET_STABLE
#define PLUGIN_SET_STABLE
#endif
#ifndef PLUGIN_SET_TESTING
#define PLUGIN_SET_TESTING
#endif
// #ifndef PLUGIN_SET_EXPERIMENTAL
// #define PLUGIN_SET_EXPERIMENTAL
// #endif
#endif
@@ -863,13 +894,14 @@ To create/register a plugin, you have to :
// TESTING #####################################
#ifdef PLUGIN_SET_TESTING
#ifndef LIMIT_BUILD_SIZE
#define LIMIT_BUILD_SIZE
#endif
#ifndef NOTIFIER_SET_NONE
#define NOTIFIER_SET_NONE
#endif
#ifndef PLUGIN_SET_MAX
#ifndef LIMIT_BUILD_SIZE
#define LIMIT_BUILD_SIZE
#endif
#ifndef NOTIFIER_SET_NONE
#define NOTIFIER_SET_NONE
#endif
#endif // PLUGIN_SET_MAX
#define USES_P045 // MPU6050
#define USES_P047 // I2C_soil_misture
@@ -1104,6 +1136,63 @@ To create/register a plugin, you have to :
#endif
// Maximized build definition for an ESP(32) with 16MB Flash and 4MB sketch partition
// Add all plugins, controllers and features that don't fit in the TESTING set
#ifdef PLUGIN_SET_MAX
// Plugins
#ifndef USES_P016
#define USES_P016 // IR
#endif
#ifndef USES_P035
#define USES_P035 // IRTX
#endif
#ifndef USES_P041
#define USES_P041 // NeoClock
#endif
#ifndef USES_P042
#define USES_P042 // Candle
#endif
#ifndef USES_P087
#define USES_P087 // Serial Proxy
#endif
#ifndef USES_P094
#define USES_P094 // CUL Reader
#endif
#ifndef USES_P095
#define USES_P095 // TFT ILI9341
#endif
#ifndef USES_P096
#define USES_P096 // eInk (Needs lib_deps = Adafruit GFX Library, LOLIN_EPD )
#endif
#ifndef USES_P099
#define USES_P099 // XPT2046 Touchscreen
#endif
#ifndef USES_P102
#define USES_P102 // PZEM004Tv3
#endif
#ifndef USES_P111
#define USES_P111 // RC522 RFID reader
#endif
// Controllers
#ifndef USES_C015
#ifndef ESP32
#define USES_C015 // Blynk (?doesn't compile on ESP32?)
#endif
#endif
#ifndef USES_C016
#ifndef ESP32 // Not implemented yet for ESP32
#define USES_C016 // Cache controller
#endif
#endif
#ifndef USES_C018
#define USES_C018 // TTN RN2483
#endif
// Notifiers
#endif // PLUGIN_SET_MAX
/******************************************************************************\
* Remove incompatible plugins ************************************************
@@ -1195,7 +1284,7 @@ To create/register a plugin, you have to :
#endif
// VCC builds need a bit more, disable timing stats to make it fit.
#ifdef FEATURE_ADC_VCC
#if defined(FEATURE_ADC_VCC) && !defined(PLUGIN_SET_MAX)
#ifndef LIMIT_BUILD_SIZE
#define LIMIT_BUILD_SIZE
#endif
+2 -2
View File
@@ -212,7 +212,7 @@ void addDeviceSelect(const String& name, int choice)
deviceName = getPluginNameFromDeviceIndex(deviceIndex);
# ifdef PLUGIN_BUILD_DEV
# if defined(PLUGIN_BUILD_DEV) || defined(PLUGIN_SET_MAX)
String plugin = "P";
if (pluginID < 10) { plugin += '0'; }
@@ -221,7 +221,7 @@ void addDeviceSelect(const String& name, int choice)
plugin += pluginID;
plugin += F(" - ");
deviceName = plugin + deviceName;
# endif // ifdef PLUGIN_BUILD_DEV
# endif // if defined(PLUGIN_BUILD_DEV) || defined(PLUGIN_SET_MAX)
addSelector_Item(deviceName,
Device[deviceIndex].Number,
+3
View File
@@ -23,6 +23,9 @@ def get_max_bin_size(env_name, file_suffix):
if "factory" in file_suffix:
# Factory bin files include a part which is not overwritten via OTA
max_bin_size = max_bin_size + 65536
if "_16M8124k" in env_name:
# ESP32 with 4096k of sketch space.
max_bin_size = 4194304
if "debug_" in env_name:
# Debug env, used for analysis, not to be run on a node.
max_bin_size = 0