Skip to content

Commit abb9593

Browse files
authored
Merge pull request SHA2017-badge#232 from SHA2017-badge/basvs-upstream-6cc80996
fix compatibilities with newer esp-idf
2 parents e6b3f30 + 6216d04 commit abb9593

File tree

3 files changed

+49
-27
lines changed

3 files changed

+49
-27
lines changed

esp32/Makefile

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ ESPCOMP = $(ESPIDF)/components
3838
ESPTOOL ?= $(ESPCOMP)/esptool_py/esptool/esptool.py
3939

4040
# verify the ESP IDF version
41-
ESPIDF_SUPHASH := fdcf2ba393eb7a91196882ef995bd6e9f64565e5
41+
ESPIDF_SUPHASH := 2ce9a383d326c2b2c29f0e7c87ce44db04d60c51
4242
ESPIDF_CURHASH := $(shell git -C $(ESPIDF) show -s --pretty=format:'%H')
4343
ifneq ($(ESPIDF_CURHASH),$(ESPIDF_SUPHASH))
4444
$(info ** WARNING **)
@@ -125,7 +125,7 @@ LDFLAGS = -nostdlib -Map=$(@:.elf=.map) --cref
125125
LDFLAGS += --gc-sections -static -EL
126126
LDFLAGS += -u call_user_start_cpu0 -u uxTopUsedPriority
127127
LDFLAGS += -u __cxa_guard_dummy # so that implementation of static guards is taken from cxx_guards.o instead of libstdc++.a
128-
LDFLAGS += -L$(ESPCOMP)/esp32/ld -T $(BUILD)/esp32_out.ld -T ./esp32.custom_common.ld -T esp32.rom.ld -T esp32.rom.spiflash.ld -T esp32.peripherals.ld
128+
LDFLAGS += -L$(ESPCOMP)/esp32/ld -T $(BUILD)/esp32_out.ld -T ./esp32.custom_common.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.rom.spiram_incompatible_fns.ld
129129

130130
LIBGCC_FILE_NAME = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
131131
LIBSTDCXX_FILE_NAME = $(shell $(CXX) $(CXXFLAGS) -print-file-name=libstdc++.a)
@@ -284,7 +284,6 @@ ESPIDF_ESP32_O = $(addprefix $(ESPCOMP)/esp32/,\
284284
cpu_start.o \
285285
gdbstub.o \
286286
crosscore_int.o \
287-
deep_sleep.o \
288287
ipc.o \
289288
int_wdt.o \
290289
event_loop.o \
@@ -300,6 +299,16 @@ ESPIDF_ESP32_O = $(addprefix $(ESPCOMP)/esp32/,\
300299
brownout.o \
301300
fast_crypto_ops.o \
302301
wifi_init.o \
302+
wifi_internal.o \
303+
sleep_modes.o \
304+
esp_timer.o \
305+
esp_timer_esp32.o \
306+
ets_timer_legacy.o \
307+
)
308+
309+
ESPIDF_PTHREAD_O = $(addprefix $(ESPCOMP)/pthread/,\
310+
pthread.o \
311+
pthread_local_storage.o \
303312
)
304313

305314
ESPIDF_HEAP_O = $(addprefix $(ESPCOMP)/heap/,\
@@ -530,11 +539,11 @@ ESPIDF_LWIP_O = $(addprefix $(ESPCOMP)/lwip/,\
530539
port/freertos/sys_arch.o \
531540
port/netif/wlanif.o \
532541
port/netif/ethernetif.o \
542+
port/vfs_lwip.o \
533543
)
534544

535545
ESPIDF_MBEDTLS_O = $(addprefix $(ESPCOMP)/mbedtls/,\
536546
library/entropy.o \
537-
library/net.o \
538547
library/pkcs12.o \
539548
library/ccm.o \
540549
library/pk.o \
@@ -603,7 +612,7 @@ ESPIDF_MBEDTLS_O = $(addprefix $(ESPCOMP)/mbedtls/,\
603612
library/ctr_drbg.o \
604613
library/x509write_crt.o \
605614
library/pk_wrap.o \
606-
port/net.o \
615+
port/net_sockets.o \
607616
port/esp_bignum.o \
608617
port/esp_hardware.o \
609618
port/esp_sha1.o \
@@ -645,6 +654,7 @@ OBJ_ESPIDF =
645654
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_NEWLIB_O))
646655
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_DRIVER_O))
647656
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_ESP32_O))
657+
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_PTHREAD_O))
648658
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_HEAP_O))
649659
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_SOC_O))
650660
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_CXX_O))
@@ -760,11 +770,12 @@ APP_LD_ARGS += $(LDFLAGS_MOD)
760770
APP_LD_ARGS += --start-group
761771
APP_LD_ARGS += -L$(dir $(LIBGCC_FILE_NAME)) -lgcc
762772
APP_LD_ARGS += -L$(dir $(LIBSTDCXX_FILE_NAME)) -lstdc++
773+
APP_LD_ARGS += -lgcov
763774
APP_LD_ARGS += $(ESPCOMP)/newlib/lib/libc.a
764775
APP_LD_ARGS += $(ESPCOMP)/newlib/lib/libm.a
765776
APP_LD_ARGS += $(ESPCOMP)/esp32/libhal.a
766777
APP_LD_ARGS += $(BADGE_LIBS)
767-
APP_LD_ARGS += -L$(ESPCOMP)/esp32/lib -lcore -lnet80211 -lphy -lrtc -lpp -lwpa -lsmartconfig -lcoexist
778+
APP_LD_ARGS += -L$(ESPCOMP)/esp32/lib -lcore -lnet80211 -lphy -lrtc -lpp -lwpa -lwpa2 -lwps -lsmartconfig -lcoexist
768779
APP_LD_ARGS += $(OBJ)
769780
APP_LD_ARGS += --end-group
770781

@@ -836,7 +847,7 @@ BOOTLOADER_LDFLAGS += -Wl,-Map=$(@:.elf=.map) -Wl,--cref
836847
BOOTLOADER_LDFLAGS += -T $(ESPCOMP)/bootloader/subproject/main/esp32.bootloader.ld
837848
BOOTLOADER_LDFLAGS += -T $(ESPCOMP)/bootloader/subproject/main/esp32.bootloader.rom.ld
838849
BOOTLOADER_LDFLAGS += -T $(ESPCOMP)/esp32/ld/esp32.rom.ld
839-
BOOTLOADER_LDFLAGS += -T $(ESPCOMP)/esp32/ld/esp32.rom.spiflash.ld
850+
BOOTLOADER_LDFLAGS += -T $(ESPCOMP)/esp32/ld/esp32.rom.spiram_incompatible_fns.ld
840851

841852
BOOTLOADER_OBJ_DIRS = $(sort $(dir $(BOOTLOADER_OBJ)))
842853
$(BOOTLOADER_OBJ): | $(BOOTLOADER_OBJ_DIRS)

esp32/esp32.custom_common.ld

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -83,37 +83,46 @@ SECTIONS
8383
_iram_text_start = ABSOLUTE(.);
8484
*(.iram1 .iram1.*)
8585
*freertos/*(.literal .text .literal.* .text.*)
86+
*heap/multi_heap.o(.literal .text .literal.* .text.*)
87+
*heap/multi_heap_poisoning.o(.literal .text .literal.* .text.*)
8688
*esp32/panic.o(.literal .text .literal.* .text.*)
8789
*esp32/core_dump.o(.literal .text .literal.* .text.*)
88-
*esp32/heap_alloc_caps.o(.literal .text .literal.* .text.*)
89-
*esp32/app_trace.o(.literal .text .literal.* .text.*)
90+
*app_trace/*(.literal .text .literal.* .text.*)
91+
*xtensa-debug-module/eri.o(.literal .text .literal.* .text.*)
9092
*libphy.a:(.literal .text .literal.* .text.*)
9193
*librtc.a:(.literal .text .literal.* .text.*)
9294
*libsoc.a:(.literal .text .literal.* .text.*)
9395
*libhal.a:(.literal .text .literal.* .text.*)
96+
*libgcc.a:lib2funcs.o(.literal .text .literal.* .text.*)
9497
*spi_flash/spi_flash_rom_patch.o(.literal .text .literal.* .text.*)
98+
*libgcov.a:(.literal .text .literal.* .text.*)
9599
*py/scheduler.o*(.literal .text .literal.* .text.*)
100+
INCLUDE esp32.spiram.rom-functions-iram.ld
96101
_iram_text_end = ABSOLUTE(.);
97102
} > iram0_0_seg
98103

99104
.dram0.data :
100105
{
101106
_data_start = ABSOLUTE(.);
102-
KEEP(*(.data))
103-
KEEP(*(.data.*))
104-
KEEP(*(.gnu.linkonce.d.*))
105-
KEEP(*(.data1))
106-
KEEP(*(.sdata))
107-
KEEP(*(.sdata.*))
108-
KEEP(*(.gnu.linkonce.s.*))
109-
KEEP(*(.sdata2))
110-
KEEP(*(.sdata2.*))
111-
KEEP(*(.gnu.linkonce.s2.*))
112-
KEEP(*(.jcr))
107+
*(.data)
108+
*(.data.*)
109+
*(.gnu.linkonce.d.*)
110+
*(.data1)
111+
*(.sdata)
112+
*(.sdata.*)
113+
*(.gnu.linkonce.s.*)
114+
*(.sdata2)
115+
*(.sdata2.*)
116+
*(.gnu.linkonce.s2.*)
117+
*(.jcr)
113118
*(.dram1 .dram1.*)
114119
*esp32/panic.o(.rodata .rodata.*)
115-
*esp32/app_trace.o(.rodata .rodata.*)
116120
*libphy.a:(.rodata .rodata.*)
121+
*app_trace/*(.rodata .rodata.*)
122+
*libgcov.a:(.rodata .rodata.*)
123+
*heap/multi_heap.o(.rodata .rodata.*)
124+
*heap/multi_heap_poisoning.o(.rodata .rodata.*)
125+
INCLUDE esp32.spiram.rom-functions-dram.ld
117126
_data_end = ABSOLUTE(.);
118127
. = ALIGN(4);
119128
} >dram0_0_seg
@@ -152,11 +161,13 @@ SECTIONS
152161
*(.rodata1)
153162
__XT_EXCEPTION_TABLE_ = ABSOLUTE(.);
154163
*(.xt_except_table)
155-
*(.gcc_except_table)
164+
*(.gcc_except_table .gcc_except_table.*)
156165
*(.gnu.linkonce.e.*)
157166
*(.gnu.version_r)
158-
*(.eh_frame)
159167
. = (. + 3) & ~ 3;
168+
__eh_frame = ABSOLUTE(.);
169+
KEEP(*(.eh_frame))
170+
. = (. + 7) & ~ 3;
160171
/* C++ constructor and destructor tables, properly ordered: */
161172
__init_array_start = ABSOLUTE(.);
162173
KEEP (*crtbegin.o(.ctors))

esp32/modmachine.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,21 +90,21 @@ STATIC mp_obj_t machine_deepsleep(size_t n_args, const mp_obj_t *pos_args, mp_ma
9090
mp_int_t expiry = args[ARG_sleep_ms].u_int;
9191

9292
if (expiry != 0) {
93-
esp_deep_sleep_enable_timer_wakeup(expiry * 1000);
93+
esp_sleep_enable_timer_wakeup(expiry * 1000);
9494
}
9595

9696
if (machine_rtc_config.ext0_pin != -1) {
97-
esp_deep_sleep_enable_ext0_wakeup(machine_rtc_config.ext0_pin, machine_rtc_config.ext0_level ? 1 : 0);
97+
esp_sleep_enable_ext0_wakeup(machine_rtc_config.ext0_pin, machine_rtc_config.ext0_level ? 1 : 0);
9898
}
9999

100100
if (machine_rtc_config.ext1_pins != 0) {
101-
esp_deep_sleep_enable_ext1_wakeup(
101+
esp_sleep_enable_ext1_wakeup(
102102
machine_rtc_config.ext1_pins,
103103
machine_rtc_config.ext1_level ? ESP_EXT1_WAKEUP_ANY_HIGH : ESP_EXT1_WAKEUP_ALL_LOW);
104104
}
105105

106106
if (machine_rtc_config.wake_on_touch) {
107-
esp_deep_sleep_enable_touchpad_wakeup();
107+
esp_sleep_enable_touchpad_wakeup();
108108
}
109109

110110
esp_deep_sleep_start();

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy