Skip to content

Commit 0174bf2

Browse files
committed
IDF master 606557b48
1 parent 505926c commit 0174bf2

File tree

257 files changed

+1957
-659
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

257 files changed

+1957
-659
lines changed

platform.txt

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

tools/esptool.py

Lines changed: 24 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ class ESPLoader(object):
227227
CHIP_NAME = "Espressif device"
228228
IS_STUB = False
229229

230+
FPGA_SLOW_BOOT = False
231+
230232
DEFAULT_PORT = "/dev/ttyUSB0"
231233

232234
# Commands supported by ESP8266 ROM bootloader
@@ -540,9 +542,8 @@ def _get_pid(self):
540542
return p.pid
541543
print("\nFailed to get PID of a device on {}, using standard reset sequence.".format(active_port))
542544

543-
def bootloader_reset(self, esp32r0_delay=False, usb_jtag_serial=False):
544-
""" Issue a reset-to-bootloader, with esp32r0 workaround options
545-
and USB-JTAG-Serial custom reset sequence option
545+
def bootloader_reset(self, usb_jtag_serial=False):
546+
""" Issue a reset-to-bootloader, with USB-JTAG-Serial custom reset sequence option
546547
"""
547548
# RTS = either CH_PD/EN or nRESET (both active low = chip in reset)
548549
# DTR = GPIO0 (active low = boot to flasher)
@@ -565,35 +566,23 @@ def bootloader_reset(self, esp32r0_delay=False, usb_jtag_serial=False):
565566
self._setDTR(False)
566567
self._setRTS(False)
567568
else:
569+
# This extra delay is for Espressif internal use
570+
extra_delay = True if self.FPGA_SLOW_BOOT and os.environ.get("ESPTOOL_ENV_FPGA", "").strip() == "1" else False
571+
568572
self._setDTR(False) # IO0=HIGH
569573
self._setRTS(True) # EN=LOW, chip in reset
570574
time.sleep(0.1)
571-
if esp32r0_delay:
572-
# Some chips are more likely to trigger the esp32r0
573-
# watchdog reset silicon bug if they're held with EN=LOW
574-
# for a longer period
575-
time.sleep(1.2)
576575
self._setDTR(True) # IO0=LOW
577576
self._setRTS(False) # EN=HIGH, chip out of reset
578-
if esp32r0_delay:
579-
# Sleep longer after reset.
580-
# This workaround only works on revision 0 ESP32 chips,
581-
# it exploits a silicon bug spurious watchdog reset.
582-
time.sleep(0.4) # allow watchdog reset to occur
577+
578+
if extra_delay:
579+
time.sleep(7)
580+
583581
time.sleep(0.05)
584582
self._setDTR(False) # IO0=HIGH, done
585583

586-
def _connect_attempt(self, mode='default_reset', esp32r0_delay=False, usb_jtag_serial=False):
587-
""" A single connection attempt, with esp32r0 workaround options """
588-
# esp32r0_delay is a workaround for bugs with the most common auto reset
589-
# circuit and Windows, if the EN pin on the dev board does not have
590-
# enough capacitance.
591-
#
592-
# Newer dev boards shouldn't have this problem (higher value capacitor
593-
# on the EN pin), and ESP32 revision 1 can't use this workaround as it
594-
# relies on a silicon bug.
595-
#
596-
# Details: https://github.com/espressif/esptool/issues/136
584+
def _connect_attempt(self, mode='default_reset', usb_jtag_serial=False):
585+
""" A single connection attempt """
597586
last_error = None
598587

599588
# If we're doing no_sync, we're likely communicating as a pass through
@@ -602,7 +591,7 @@ def _connect_attempt(self, mode='default_reset', esp32r0_delay=False, usb_jtag_s
602591
return last_error
603592

604593
if mode != 'no_reset':
605-
self.bootloader_reset(esp32r0_delay, usb_jtag_serial)
594+
self.bootloader_reset(usb_jtag_serial)
606595

607596
for _ in range(5):
608597
try:
@@ -611,10 +600,7 @@ def _connect_attempt(self, mode='default_reset', esp32r0_delay=False, usb_jtag_s
611600
self.sync()
612601
return None
613602
except FatalError as e:
614-
if esp32r0_delay:
615-
print('_', end='')
616-
else:
617-
print('.', end='')
603+
print('.', end='')
618604
sys.stdout.flush()
619605
time.sleep(0.05)
620606
last_error = e
@@ -641,10 +627,7 @@ def connect(self, mode='default_reset', attempts=DEFAULT_CONNECT_ATTEMPTS, detec
641627

642628
try:
643629
for _ in range(attempts) if attempts > 0 else itertools.count():
644-
last_error = self._connect_attempt(mode=mode, esp32r0_delay=False, usb_jtag_serial=usb_jtag_serial)
645-
if last_error is None:
646-
break
647-
last_error = self._connect_attempt(mode=mode, esp32r0_delay=True, usb_jtag_serial=usb_jtag_serial)
630+
last_error = self._connect_attempt(mode=mode, usb_jtag_serial=usb_jtag_serial)
648631
if last_error is None:
649632
break
650633
finally:
@@ -1401,6 +1384,8 @@ class ESP32ROM(ESPLoader):
14011384
IMAGE_CHIP_ID = 0
14021385
IS_STUB = False
14031386

1387+
FPGA_SLOW_BOOT = True
1388+
14041389
CHIP_DETECT_MAGIC_VALUE = [0x00f01d83]
14051390

14061391
IROM_MAP_START = 0x400d0000
@@ -1673,6 +1658,8 @@ class ESP32S2ROM(ESP32ROM):
16731658
CHIP_NAME = "ESP32-S2"
16741659
IMAGE_CHIP_ID = 2
16751660

1661+
FPGA_SLOW_BOOT = False
1662+
16761663
IROM_MAP_START = 0x40080000
16771664
IROM_MAP_END = 0x40b80000
16781665
DROM_MAP_START = 0x3F000000
@@ -1900,6 +1887,8 @@ class ESP32S3ROM(ESP32ROM):
19001887

19011888
CHIP_DETECT_MAGIC_VALUE = [0x9]
19021889

1890+
FPGA_SLOW_BOOT = False
1891+
19031892
IROM_MAP_START = 0x42000000
19041893
IROM_MAP_END = 0x44000000
19051894
DROM_MAP_START = 0x3c000000
@@ -2024,6 +2013,8 @@ class ESP32C3ROM(ESP32ROM):
20242013
CHIP_NAME = "ESP32-C3"
20252014
IMAGE_CHIP_ID = 5
20262015

2016+
FPGA_SLOW_BOOT = False
2017+
20272018
IROM_MAP_START = 0x42000000
20282019
IROM_MAP_END = 0x42800000
20292020
DROM_MAP_START = 0x3c000000

tools/platformio-build-esp32.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@
295295
"UNITY_INCLUDE_CONFIG_H",
296296
"WITH_POSIX",
297297
"_GNU_SOURCE",
298-
("IDF_VER", '\\"v4.4-dev-2359-g58022f859\\"'),
298+
("IDF_VER", '\\"v4.4-dev-2464-g606557b48\\"'),
299299
"ESP_PLATFORM",
300300
"ARDUINO_ARCH_ESP32",
301301
"ESP32",

tools/platformio-build-esp32c3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@
281281
"UNITY_INCLUDE_CONFIG_H",
282282
"WITH_POSIX",
283283
"_GNU_SOURCE",
284-
("IDF_VER", '\\"v4.4-dev-2359-g58022f859\\"'),
284+
("IDF_VER", '\\"v4.4-dev-2464-g606557b48\\"'),
285285
"ESP_PLATFORM",
286286
"ARDUINO_ARCH_ESP32",
287287
"ESP32",

tools/platformio-build-esp32s2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@
281281
"UNITY_INCLUDE_CONFIG_H",
282282
"WITH_POSIX",
283283
"_GNU_SOURCE",
284-
("IDF_VER", '\\"v4.4-dev-2359-g58022f859\\"'),
284+
("IDF_VER", '\\"v4.4-dev-2464-g606557b48\\"'),
285285
"ESP_PLATFORM",
286286
"ARDUINO_ARCH_ESP32",
287287
"ESP32",
16 Bytes
Binary file not shown.
16 Bytes
Binary file not shown.
16 Bytes
Binary file not shown.
16 Bytes
Binary file not shown.
16 Bytes
Binary file not shown.
16 Bytes
Binary file not shown.
16 Bytes
Binary file not shown.
16 Bytes
Binary file not shown.

tools/sdk/esp32/include/app_update/include/esp_ota_ops.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,14 @@ const esp_partition_t* esp_ota_get_next_update_partition(const esp_partition_t *
244244
*/
245245
esp_err_t esp_ota_get_partition_description(const esp_partition_t *partition, esp_app_desc_t *app_desc);
246246

247+
/**
248+
* @brief Returns number of ota partitions provided in partition table.
249+
*
250+
* @return
251+
* - Number of OTA partitions
252+
*/
253+
uint8_t esp_ota_get_app_partition_count(void);
254+
247255
/**
248256
* @brief This function is called to indicate that the running app is working well.
249257
*

tools/sdk/esp32/include/bootloader_support/include/bootloader_flash.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
#include "sdkconfig.h"
1111
#include "soc/soc_caps.h"
1212

13+
#ifdef __cplusplus
14+
extern "C" {
15+
#endif
16+
1317
#if SOC_CACHE_SUPPORT_WRAP
1418
/**
1519
* @brief Set the burst mode setting command for specified wrap mode.
@@ -19,3 +23,15 @@
1923
*/
2024
esp_err_t bootloader_flash_wrap_set(spi_flash_wrap_mode_t mode);
2125
#endif
26+
27+
/**
28+
* @brief Unlock Flash write protect.
29+
* Please do not call this function in SDK.
30+
*
31+
* @note This can be overridden because it's attribute weak.
32+
*/
33+
esp_err_t bootloader_flash_unlock(void);
34+
35+
#ifdef __cplusplus
36+
}
37+
#endif

tools/sdk/esp32/include/config/sdkconfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,5 +690,5 @@
690690
#define CONFIG_ULP_COPROC_ENABLED CONFIG_ESP32_ULP_COPROC_ENABLED
691691
#define CONFIG_ULP_COPROC_RESERVE_MEM CONFIG_ESP32_ULP_COPROC_RESERVE_MEM
692692
#define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS
693-
#define CONFIG_ARDUINO_IDF_COMMIT "58022f859"
693+
#define CONFIG_ARDUINO_IDF_COMMIT "606557b48"
694694
#define CONFIG_ARDUINO_IDF_BRANCH "master"

0 commit comments

Comments
 (0)