Skip to content

Commit 5b20197

Browse files
author
me-no-dev
committed
IDF release/v3.3 46b12a560
1 parent 79e4339 commit 5b20197

File tree

245 files changed

+10790
-3503
lines changed

Some content is hidden

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

245 files changed

+10790
-3503
lines changed

platform.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ compiler.warning_flags.all=-Wall -Werror=all -Wextra
2222

2323
compiler.path={runtime.tools.xtensa-esp32-elf-gcc.path}/bin/
2424
compiler.sdk.path={runtime.platform.path}/tools/sdk
25-
compiler.cpreprocessor.flags=-DESP_PLATFORM -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DHAVE_CONFIG_H -DGCC_NOT_5_2_0=0 -DWITH_POSIX "-I{compiler.sdk.path}/include/config" "-I{compiler.sdk.path}/include/app_trace" "-I{compiler.sdk.path}/include/app_update" "-I{compiler.sdk.path}/include/asio" "-I{compiler.sdk.path}/include/bootloader_support" "-I{compiler.sdk.path}/include/bt" "-I{compiler.sdk.path}/include/coap" "-I{compiler.sdk.path}/include/console" "-I{compiler.sdk.path}/include/driver" "-I{compiler.sdk.path}/include/esp-tls" "-I{compiler.sdk.path}/include/esp32" "-I{compiler.sdk.path}/include/esp_adc_cal" "-I{compiler.sdk.path}/include/esp_event" "-I{compiler.sdk.path}/include/esp_http_client" "-I{compiler.sdk.path}/include/esp_http_server" "-I{compiler.sdk.path}/include/esp_https_ota" "-I{compiler.sdk.path}/include/esp_ringbuf" "-I{compiler.sdk.path}/include/ethernet" "-I{compiler.sdk.path}/include/expat" "-I{compiler.sdk.path}/include/fatfs" "-I{compiler.sdk.path}/include/freemodbus" "-I{compiler.sdk.path}/include/freertos" "-I{compiler.sdk.path}/include/heap" "-I{compiler.sdk.path}/include/idf_test" "-I{compiler.sdk.path}/include/jsmn" "-I{compiler.sdk.path}/include/json" "-I{compiler.sdk.path}/include/libsodium" "-I{compiler.sdk.path}/include/log" "-I{compiler.sdk.path}/include/lwip" "-I{compiler.sdk.path}/include/mbedtls" "-I{compiler.sdk.path}/include/mdns" "-I{compiler.sdk.path}/include/micro-ecc" "-I{compiler.sdk.path}/include/mqtt" "-I{compiler.sdk.path}/include/newlib" "-I{compiler.sdk.path}/include/nghttp" "-I{compiler.sdk.path}/include/nvs_flash" "-I{compiler.sdk.path}/include/openssl" "-I{compiler.sdk.path}/include/protobuf-c" "-I{compiler.sdk.path}/include/protocomm" "-I{compiler.sdk.path}/include/pthread" "-I{compiler.sdk.path}/include/sdmmc" "-I{compiler.sdk.path}/include/smartconfig_ack" "-I{compiler.sdk.path}/include/soc" "-I{compiler.sdk.path}/include/spi_flash" "-I{compiler.sdk.path}/include/spiffs" "-I{compiler.sdk.path}/include/tcp_transport" "-I{compiler.sdk.path}/include/tcpip_adapter" "-I{compiler.sdk.path}/include/ulp" "-I{compiler.sdk.path}/include/vfs" "-I{compiler.sdk.path}/include/wear_levelling" "-I{compiler.sdk.path}/include/wifi_provisioning" "-I{compiler.sdk.path}/include/wpa_supplicant" "-I{compiler.sdk.path}/include/xtensa-debug-module" "-I{compiler.sdk.path}/include/esp-face" "-I{compiler.sdk.path}/include/esp32-camera" "-I{compiler.sdk.path}/include/esp-face" "-I{compiler.sdk.path}/include/fb_gfx"
25+
compiler.cpreprocessor.flags=-DESP_PLATFORM -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DHAVE_CONFIG_H -DGCC_NOT_5_2_0=0 -DWITH_POSIX "-I{compiler.sdk.path}/include/config" "-I{compiler.sdk.path}/include/app_trace" "-I{compiler.sdk.path}/include/app_update" "-I{compiler.sdk.path}/include/asio" "-I{compiler.sdk.path}/include/bootloader_support" "-I{compiler.sdk.path}/include/bt" "-I{compiler.sdk.path}/include/coap" "-I{compiler.sdk.path}/include/console" "-I{compiler.sdk.path}/include/driver" "-I{compiler.sdk.path}/include/efuse" "-I{compiler.sdk.path}/include/esp-tls" "-I{compiler.sdk.path}/include/esp32" "-I{compiler.sdk.path}/include/esp_adc_cal" "-I{compiler.sdk.path}/include/esp_event" "-I{compiler.sdk.path}/include/esp_http_client" "-I{compiler.sdk.path}/include/esp_http_server" "-I{compiler.sdk.path}/include/esp_https_ota" "-I{compiler.sdk.path}/include/esp_https_server" "-I{compiler.sdk.path}/include/esp_ringbuf" "-I{compiler.sdk.path}/include/espcoredump" "-I{compiler.sdk.path}/include/ethernet" "-I{compiler.sdk.path}/include/expat" "-I{compiler.sdk.path}/include/fatfs" "-I{compiler.sdk.path}/include/freemodbus" "-I{compiler.sdk.path}/include/freertos" "-I{compiler.sdk.path}/include/heap" "-I{compiler.sdk.path}/include/idf_test" "-I{compiler.sdk.path}/include/jsmn" "-I{compiler.sdk.path}/include/json" "-I{compiler.sdk.path}/include/libsodium" "-I{compiler.sdk.path}/include/log" "-I{compiler.sdk.path}/include/lwip" "-I{compiler.sdk.path}/include/mbedtls" "-I{compiler.sdk.path}/include/mdns" "-I{compiler.sdk.path}/include/micro-ecc" "-I{compiler.sdk.path}/include/mqtt" "-I{compiler.sdk.path}/include/newlib" "-I{compiler.sdk.path}/include/nghttp" "-I{compiler.sdk.path}/include/nvs_flash" "-I{compiler.sdk.path}/include/openssl" "-I{compiler.sdk.path}/include/protobuf-c" "-I{compiler.sdk.path}/include/protocomm" "-I{compiler.sdk.path}/include/pthread" "-I{compiler.sdk.path}/include/sdmmc" "-I{compiler.sdk.path}/include/smartconfig_ack" "-I{compiler.sdk.path}/include/soc" "-I{compiler.sdk.path}/include/spi_flash" "-I{compiler.sdk.path}/include/spiffs" "-I{compiler.sdk.path}/include/tcp_transport" "-I{compiler.sdk.path}/include/tcpip_adapter" "-I{compiler.sdk.path}/include/ulp" "-I{compiler.sdk.path}/include/unity" "-I{compiler.sdk.path}/include/vfs" "-I{compiler.sdk.path}/include/wear_levelling" "-I{compiler.sdk.path}/include/wifi_provisioning" "-I{compiler.sdk.path}/include/wpa_supplicant" "-I{compiler.sdk.path}/include/xtensa-debug-module" "-I{compiler.sdk.path}/include/esp-face" "-I{compiler.sdk.path}/include/esp32-camera" "-I{compiler.sdk.path}/include/esp-face" "-I{compiler.sdk.path}/include/fb_gfx"
2626

2727
compiler.c.cmd=xtensa-esp32-elf-gcc
2828
compiler.c.flags=-std=gnu99 -Os -g3 -fstack-protector -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wpointer-arith {compiler.warning_flags} -Wno-maybe-uninitialized -Wno-unused-function -Wno-unused-but-set-variable -Wno-unused-variable -Wno-deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -Wno-old-style-declaration -MMD -c
@@ -35,7 +35,7 @@ compiler.S.flags=-c -g3 -x assembler-with-cpp -MMD -mlongcalls
3535

3636
compiler.c.elf.cmd=xtensa-esp32-elf-gcc
3737
compiler.c.elf.flags=-nostdlib "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" -T esp32_out.ld -T esp32.common.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.rom.libgcc.ld -T esp32.rom.spiram_incompatible_fns.ld -u ld_include_panic_highint_hdl -u call_user_start_cpu0 -Wl,--gc-sections -Wl,-static -Wl,--undefined=uxTopUsedPriority -u __cxa_guard_dummy -u __cxx_fatal_exception
38-
compiler.c.elf.libs=-lgcc -lesp32 -lphy -lesp_http_client -lmbedtls -lrtc -lesp_http_server -lbtdm_app -lspiffs -lbootloader_support -lmdns -lnvs_flash -lfatfs -lpp -lnet80211 -ljsmn -lface_detection -llibsodium -lvfs -ldl_lib -llog -lfreertos -lcxx -lsmartconfig_ack -lxtensa-debug-module -lheap -ltcpip_adapter -lmqtt -lulp -lfd -lfb_gfx -lnghttp -lprotocomm -lsmartconfig -lm -lethernet -limage_util -lc_nano -lsoc -ltcp_transport -lc -lmicro-ecc -lface_recognition -ljson -lwpa_supplicant -lmesh -lesp_https_ota -lwpa2 -lexpat -llwip -lwear_levelling -lapp_update -ldriver -lbt -lespnow -lcoap -lasio -lnewlib -lconsole -lapp_trace -lesp32-camera -lhal -lprotobuf-c -lsdmmc -lcore -lpthread -lcoexist -lfreemodbus -lspi_flash -lesp-tls -lwpa -lwifi_provisioning -lwps -lesp_adc_cal -lesp_event -lopenssl -lesp_ringbuf -lfr -lstdc++
38+
compiler.c.elf.libs=-lgcc -lesp32 -lphy -lesp_http_client -lmbedtls -lrtc -lesp_http_server -lbtdm_app -lspiffs -lbootloader_support -lmdns -lnvs_flash -lfatfs -lpp -lnet80211 -ljsmn -lface_detection -llibsodium -lvfs -ldl_lib -llog -lfreertos -lcxx -lsmartconfig_ack -lxtensa-debug-module -lheap -ltcpip_adapter -lmqtt -lulp -lfd -lfb_gfx -lnghttp -lunity -lprotocomm -lespcoredump -lesp_https_server -lsmartconfig -lm -lethernet -limage_util -lc_nano -lsoc -ltcp_transport -lc -lmicro-ecc -lface_recognition -ljson -lwpa_supplicant -lmesh -lesp_https_ota -lwpa2 -lexpat -llwip -lwear_levelling -lapp_update -ldriver -lbt -lespnow -lcoap -lasio -lnewlib -lconsole -lapp_trace -lesp32-camera -lhal -lprotobuf-c -lsdmmc -lcore -lpthread -lcoexist -lfreemodbus -lspi_flash -lesp-tls -lwpa -lwifi_provisioning -lwps -lesp_adc_cal -lesp_event -lopenssl -lesp_ringbuf -lefuse -lfr -lstdc++
3939

4040
compiler.as.cmd=xtensa-esp32-elf-as
4141

tools/esptool.py

Lines changed: 10 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,11 +1018,6 @@ class ESP8266ROM(ESPLoader):
10181018

10191019
BOOTLOADER_FLASH_OFFSET = 0
10201020

1021-
MEMORY_MAP = [[0x3FF00000, 0x3FF00010, "DPORT"],
1022-
[0x3FFE8000, 0x40000000, "DRAM"],
1023-
[0x40100000, 0x40108000, "IRAM"],
1024-
[0x40201010, 0x402E1010, "IROM"]]
1025-
10261021
def get_efuses(self):
10271022
# Return the 128 bits of ESP8266 efuse as a single Python integer
10281023
return (self.read_reg(0x3ff0005c) << 96 |
@@ -1121,7 +1116,6 @@ class ESP32ROM(ESPLoader):
11211116
11221117
"""
11231118
CHIP_NAME = "ESP32"
1124-
IMAGE_CHIP_ID = 0
11251119
IS_STUB = False
11261120

11271121
DATE_REG_VALUE = 0x15122500
@@ -1158,22 +1152,6 @@ class ESP32ROM(ESPLoader):
11581152

11591153
OVERRIDE_VDDSDIO_CHOICES = ["1.8V", "1.9V", "OFF"]
11601154

1161-
MEMORY_MAP = [[0x3F400000, 0x3F800000, "DROM"],
1162-
[0x3F800000, 0x3FC00000, "EXTRAM_DATA"],
1163-
[0x3FF80000, 0x3FF82000, "RTC_DRAM"],
1164-
[0x3FF90000, 0x40000000, "BYTE_ACCESSIBLE"],
1165-
[0x3FFAE000, 0x40000000, "DRAM"],
1166-
[0x3FFAE000, 0x40000000, "DMA"],
1167-
[0x3FFE0000, 0x3FFFFFFC, "DIRAM_DRAM"],
1168-
[0x40000000, 0x40070000, "IROM"],
1169-
[0x40070000, 0x40078000, "CACHE_PRO"],
1170-
[0x40078000, 0x40080000, "CACHE_APP"],
1171-
[0x40080000, 0x400A0000, "IRAM"],
1172-
[0x400A0000, 0x400BFFFC, "DIRAM_IRAM"],
1173-
[0x400C0000, 0x400C2000, "RTC_IRAM"],
1174-
[0x400D0000, 0x40400000, "IROM"],
1175-
[0x50000000, 0x50002000, "RTC_DATA"]]
1176-
11771155
""" Try to read the BLOCK1 (encryption key) and check if it is valid """
11781156

11791157
def is_flash_encryption_key_valid(self):
@@ -1714,7 +1692,7 @@ class ESP32FirmwareImage(BaseFirmwareImage):
17141692
# to be set to this value so ROM bootloader will skip it.
17151693
WP_PIN_DISABLED = 0xEE
17161694

1717-
EXTENDED_HEADER_STRUCT_FMT = "<BBBBHB" + ("B" * 8) + "B"
1695+
EXTENDED_HEADER_STRUCT_FMT = "B" * 16
17181696

17191697
IROM_ALIGN = 65536
17201698

@@ -1732,7 +1710,6 @@ def __init__(self, load_file=None):
17321710
self.cs_drv = 0
17331711
self.hd_drv = 0
17341712
self.wp_drv = 0
1735-
self.min_rev = 0
17361713

17371714
self.append_digest = True
17381715

@@ -1902,20 +1879,14 @@ def split_byte(n):
19021879
self.d_drv, self.cs_drv = split_byte(fields[2])
19031880
self.hd_drv, self.wp_drv = split_byte(fields[3])
19041881

1905-
chip_id = fields[4]
1906-
if chip_id != self.ROM_LOADER.IMAGE_CHIP_ID:
1907-
print("Unexpected chip id in image. Expected %d but value was %d. Is this image for a different chip model?" % (self.ROM_LOADER.IMAGE_CHIP_ID, chip_id))
1908-
1909-
# reserved fields in the middle should all be zero
1910-
if any(f for f in fields[6:-1] if f != 0):
1911-
print("Warning: some reserved header fields have non-zero values. This image may be from a newer esptool.py?")
1912-
1913-
append_digest = fields[-1] # last byte is append_digest
1914-
if append_digest in [0, 1]:
1915-
self.append_digest = (append_digest == 1)
1882+
if fields[15] in [0, 1]:
1883+
self.append_digest = (fields[15] == 1)
19161884
else:
1917-
raise RuntimeError("Invalid value for append_digest field (0x%02x). Should be 0 or 1.", append_digest)
1885+
raise RuntimeError("Invalid value for append_digest field (0x%02x). Should be 0 or 1.", fields[15])
19181886

1887+
# remaining fields in the middle should all be zero
1888+
if any(f for f in fields[4:15] if f != 0):
1889+
print("Warning: some reserved header fields have non-zero values. This image may be from a newer esptool.py?")
19191890

19201891
def save_extended_header(self, save_file):
19211892
def join_byte(ln,hn):
@@ -1926,10 +1897,8 @@ def join_byte(ln,hn):
19261897
fields = [self.wp_pin,
19271898
join_byte(self.clk_drv, self.q_drv),
19281899
join_byte(self.d_drv, self.cs_drv),
1929-
join_byte(self.hd_drv, self.wp_drv),
1930-
self.ROM_LOADER.IMAGE_CHIP_ID,
1931-
self.min_rev]
1932-
fields += [0] * 8 # padding
1900+
join_byte(self.hd_drv, self.wp_drv)]
1901+
fields += [0] * 11
19331902
fields += [append_digest]
19341903

19351904
packed = struct.pack(self.EXTENDED_HEADER_STRUCT_FMT, *fields)
@@ -2432,8 +2401,7 @@ def image_info(args):
24322401
idx = 0
24332402
for seg in image.segments:
24342403
idx += 1
2435-
seg_name = ", ".join([seg_range[2] for seg_range in image.ROM_LOADER.MEMORY_MAP if seg_range[0] <= seg.addr < seg_range[1]])
2436-
print('Segment %d: %r [%s]' % (idx, seg, seg_name))
2404+
print('Segment %d: %r' % (idx, seg))
24372405
calc_checksum = image.calculate_checksum()
24382406
print('Checksum: %02x (%s)' % (image.checksum,
24392407
'valid' if image.checksum == calc_checksum else 'invalid - calculated %02x' % calc_checksum))
@@ -2471,7 +2439,6 @@ def elf2image(args):
24712439
if args.chip == 'esp32':
24722440
image = ESP32FirmwareImage()
24732441
image.secure_pad = args.secure_pad
2474-
image.min_rev = int(args.min_rev)
24752442
elif args.version == '1': # ESP8266
24762443
image = ESP8266ROMFirmwareImage()
24772444
else:
@@ -2770,7 +2737,6 @@ def add_spi_flash_subparsers(parent, is_elf2image):
27702737
parser_elf2image.add_argument('input', help='Input ELF file')
27712738
parser_elf2image.add_argument('--output', '-o', help='Output filename prefix (for version 1 image), or filename (for version 2 single image)', type=str)
27722739
parser_elf2image.add_argument('--version', '-e', help='Output image version', choices=['1','2'], default='1')
2773-
parser_elf2image.add_argument('--min-rev', '-r', help='Minimum chip revision', choices=['0','1','2','3'], default='0')
27742740
parser_elf2image.add_argument('--secure-pad', action='store_true', help='Pad image so once signed it will end on a 64KB boundary. For ESP32 images only.')
27752741
parser_elf2image.add_argument('--elf-sha256-offset', help='If set, insert SHA256 hash (32 bytes) of the input ELF file at specified offset in the binary.',
27762742
type=arg_auto_int, default=None)

0 commit comments

Comments
 (0)