Skip to content

Commit fb8fe67

Browse files
authored
New partitions (#192)
* Add new partition scheme * Init NVS early, so it can be used without BT or WiFi
1 parent 1f0df1e commit fb8fe67

File tree

7 files changed

+13
-12
lines changed

7 files changed

+13
-12
lines changed

cores/esp32/esp32-hal-misc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ void arduino_phy_init()
2828
if(initialized){
2929
return;
3030
}
31-
nvs_flash_init();
3231
esp_phy_calibration_mode_t calibration_mode = PHY_RF_CAL_PARTIAL;
3332
if (rtc_get_reset_reason(0) == DEEPSLEEP_RESET) {
3433
calibration_mode = PHY_RF_CAL_NONE;
@@ -106,6 +105,7 @@ void initWiFi() __attribute__((weak));
106105
void initWiFi() {}
107106

108107
void initArduino(){
108+
nvs_flash_init();
109109
init();
110110
initVariant();
111111
initWiFi();

libraries/WiFi/src/WiFiAP.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ const char * WiFiAPClass::softAPgetHostname()
253253
*/
254254
bool WiFiAPClass::softAPsetHostname(const char * hostname)
255255
{
256-
return tcpip_adapter_set_hostname(TCPIP_ADAPTER_IF_AP, hostname) == 0;
256+
return tcpip_adapter_set_hostname(TCPIP_ADAPTER_IF_AP, hostname) == ESP_OK;
257257
}
258258

259259
/**
@@ -262,7 +262,7 @@ bool WiFiAPClass::softAPsetHostname(const char * hostname)
262262
*/
263263
bool WiFiAPClass::softAPenableIpV6()
264264
{
265-
return tcpip_adapter_create_ip6_linklocal(TCPIP_ADAPTER_IF_AP) == 0;
265+
return tcpip_adapter_create_ip6_linklocal(TCPIP_ADAPTER_IF_AP) == ESP_OK;
266266
}
267267

268268
/**

platform.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,4 @@ recipe.size.regex.data=^(?:\.dram0\.data|\.dram0\.bss)\s+([0-9]+).*
8787
tools.esptool.upload.protocol=esp32
8888
tools.esptool.upload.params.verbose=
8989
tools.esptool.upload.params.quiet=
90-
tools.esptool.upload.pattern={cmd} --chip esp32 --port "{serial.port}" --baud {upload.speed} --before default_reset --after hard_reset write_flash -z --flash_freq {build.flash_freq} --flash_mode {build.flash_mode} --flash_size {build.flash_size} 0x1000 "{runtime.platform.path}/tools/sdk/bin/bootloader.bin" 0x8000 "{build.path}/{build.project_name}.partitions.bin" 0x10000 "{build.path}/{build.project_name}.bin"
90+
tools.esptool.upload.pattern={cmd} --chip esp32 --port "{serial.port}" --baud {upload.speed} --before default_reset --after hard_reset write_flash -z --flash_freq {build.flash_freq} --flash_mode {build.flash_mode} --flash_size {build.flash_size} 0x1000 "{runtime.platform.path}/tools/sdk/bin/bootloader.bin" 0x8000 "{build.path}/{build.project_name}.partitions.bin" 0xe000 "{runtime.platform.path}/tools/partitions/boot_app0.bin" 0x10000 "{build.path}/{build.project_name}.bin"

tools/partitions/boot_app0.bin

8 KB
Binary file not shown.

tools/partitions/default.bin

3 KB
Binary file not shown.

tools/partitions/default.csv

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Name, Type, SubType, Offset, Size, Flags
2-
nvs, data, nvs, 0x9000, 0x6000,
3-
phy_init, data, phy, 0xf000, 0x1000,
4-
factory, app, factory, 0x10000, 1M,
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, 1M,
5+
app1, app, ota_1, , 1M,
6+
spiffs, data, spiffs, , 0x1F0000,

tools/platformio-build.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,9 @@
102102
],
103103

104104
UPLOADERFLAGS=[
105-
"0x1000", '"%s"' % join(FRAMEWORK_DIR, "tools",
106-
"sdk", "bin", "bootloader.bin"),
107-
"0x8000", '"%s"' % join(FRAMEWORK_DIR, "tools",
108-
"sdk", "bin", "partitions_singleapp.bin"),
105+
"0x1000", '"%s"' % join(FRAMEWORK_DIR, "tools", "sdk", "bin", "bootloader.bin"),
106+
"0x8000", '"%s"' % join(FRAMEWORK_DIR, "tools", "partitions", "default.bin"),
107+
"0xe000", '"%s"' % join(FRAMEWORK_DIR, "tools", "partitions", "boot_app0.bin"),
109108
"0x10000"
110109
]
111110
)

0 commit comments

Comments
 (0)