@@ -51,8 +51,9 @@ OBJDUMP = $(CROSS_COMPILE)objdump
51
51
SDKCONFIG_COMBINED = $(BUILD ) /sdkconfig.combined
52
52
SDKCONFIG_H = $(BUILD ) /sdkconfig.h
53
53
54
- # the git hash of the currently supported ESP IDF version
55
- ESPIDF_SUPHASH_V3 := 6ccb4cf5b7d1fdddb8c2492f9cbc926abaf230df
54
+ # The git hash of the currently supported ESP IDF version.
55
+ # These correspond to v3.3.1 and v4.0-beta1.
56
+ ESPIDF_SUPHASH_V3 := 143d26aa49df524e10fb8e41a71d12e731b9b71d
56
57
ESPIDF_SUPHASH_V4 := 310beae373446ceb9a4ad9b36b5428d7fdf2705f
57
58
58
59
define print_supported_git_hash
@@ -112,15 +113,13 @@ $(info Add the xtensa toolchain to your PATH. See README.md)
112
113
$(error C compiler missing)
113
114
endif
114
115
115
- # Support BLE by default when building with IDF 4.x .
116
+ # Support BLE by default.
116
117
# Can be explicitly disabled on the command line or board config.
117
- ifeq ($(ESPIDF_CURHASH ) ,$(ESPIDF_SUPHASH_V4 ) )
118
118
MICROPY_PY_BLUETOOTH ?= 1
119
119
ifeq ($(MICROPY_PY_BLUETOOTH ) ,1)
120
120
SDKCONFIG += boards/sdkconfig.ble
121
121
MICROPY_BLUETOOTH_NIMBLE = 1
122
122
endif
123
- endif
124
123
125
124
# include sdkconfig to get needed configuration values
126
125
include $(SDKCONFIG )
@@ -158,6 +157,7 @@ INC_ESPCOMP += -I$(ESPCOMP)/tcpip_adapter/include
158
157
INC_ESPCOMP += -I$(ESPCOMP ) /lwip/lwip/src/include
159
158
INC_ESPCOMP += -I$(ESPCOMP ) /lwip/port/esp32/include
160
159
INC_ESPCOMP += -I$(ESPCOMP ) /lwip/include/apps
160
+ INC_ESPCOMP += -I$(ESPCOMP ) /lwip/include/apps/sntp
161
161
INC_ESPCOMP += -I$(ESPCOMP ) /mbedtls/mbedtls/include
162
162
INC_ESPCOMP += -I$(ESPCOMP ) /mbedtls/port/include
163
163
INC_ESPCOMP += -I$(ESPCOMP ) /mdns/include
@@ -218,9 +218,28 @@ INC_ESPCOMP += -I$(ESPCOMP)/json/port/include
218
218
INC_ESPCOMP += -I$(ESPCOMP ) /micro-ecc/micro-ecc
219
219
INC_ESPCOMP += -I$(ESPCOMP ) /nghttp/port/include
220
220
INC_ESPCOMP += -I$(ESPCOMP ) /nghttp/nghttp2/lib/includes
221
+ ifeq ($(CONFIG_NIMBLE_ENABLED ) ,y)
222
+ INC_ESPCOMP += -I$(ESPCOMP ) /bt/include
223
+ INC_ESPCOMP += -I$(ESPCOMP ) /nimble/nimble/porting/nimble/include
224
+ INC_ESPCOMP += -I$(ESPCOMP ) /nimble/port/include
225
+ INC_ESPCOMP += -I$(ESPCOMP ) /nimble/nimble/nimble/include
226
+ INC_ESPCOMP += -I$(ESPCOMP ) /nimble/nimble/nimble/host/include
227
+ INC_ESPCOMP += -I$(ESPCOMP ) /nimble/nimble/nimble/host/services/ans/include
228
+ INC_ESPCOMP += -I$(ESPCOMP ) /nimble/nimble/nimble/host/services/bas/include
229
+ INC_ESPCOMP += -I$(ESPCOMP ) /nimble/nimble/nimble/host/services/gap/include
230
+ INC_ESPCOMP += -I$(ESPCOMP ) /nimble/nimble/nimble/host/services/gatt/include
231
+ INC_ESPCOMP += -I$(ESPCOMP ) /nimble/nimble/nimble/host/services/ias/include
232
+ INC_ESPCOMP += -I$(ESPCOMP ) /nimble/nimble/nimble/host/services/lls/include
233
+ INC_ESPCOMP += -I$(ESPCOMP ) /nimble/nimble/nimble/host/services/tps/include
234
+ INC_ESPCOMP += -I$(ESPCOMP ) /nimble/nimble/nimble/host/util/include
235
+ INC_ESPCOMP += -I$(ESPCOMP ) /nimble/nimble/nimble/host/store/ram/include
236
+ INC_ESPCOMP += -I$(ESPCOMP ) /nimble/nimble/nimble/host/store/config/include
237
+ INC_ESPCOMP += -I$(ESPCOMP ) /nimble/nimble/porting/npl/freertos/include
238
+ INC_ESPCOMP += -I$(ESPCOMP ) /nimble/nimble/ext/tinycrypt/include
239
+ INC_ESPCOMP += -I$(ESPCOMP ) /nimble/esp-hci/include
240
+ endif
221
241
endif
222
242
223
- ifeq ($(ESPIDF_CURHASH ) ,$(ESPIDF_SUPHASH_V4 ) )
224
243
ifeq ($(MICROPY_PY_BLUETOOTH ) ,1)
225
244
CFLAGS_MOD += -DMICROPY_PY_BLUETOOTH=1
226
245
CFLAGS_MOD += -DMICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE=1
@@ -229,7 +248,6 @@ ifeq ($(MICROPY_BLUETOOTH_NIMBLE),1)
229
248
CFLAGS_MOD += -DMICROPY_BLUETOOTH_NIMBLE=1
230
249
endif
231
250
endif
232
- endif
233
251
234
252
# these flags are common to C and C++ compilation
235
253
CFLAGS_COMMON = -Os -ffunction-sections -fdata-sections -fstrict-volatile-bitfields \
@@ -421,6 +439,7 @@ ESPIDF_SOC_O = $(patsubst %.c,%.o,\
421
439
$(wildcard $(ESPCOMP ) /soc/src/hal/* .c) \
422
440
)
423
441
442
+ $(BUILD ) /$(ESPCOMP ) /cxx/cxx_guards.o : CXXFLAGS += -Wno-error=sign-compare
424
443
ESPIDF_CXX_O = $(patsubst % .cpp,% .o,$(wildcard $(ESPCOMP ) /cxx/* .cpp) )
425
444
426
445
ESPIDF_PTHREAD_O = $(patsubst % .c,% .o,$(wildcard $(ESPCOMP ) /pthread/* .c) )
@@ -458,6 +477,7 @@ ESPIDF_APP_UPDATE_O = $(patsubst %.c,%.o,$(wildcard $(ESPCOMP)/app_update/*.c))
458
477
459
478
ESPIDF_NEWLIB_O = $(patsubst % .c,% .o,$(wildcard $(ESPCOMP ) /newlib/* .c) )
460
479
480
+ $(BUILD ) /$(ESPCOMP ) /nvs_flash/src/nvs_api.o : CXXFLAGS += -Wno-error=sign-compare
461
481
ESPIDF_NVS_FLASH_O = $(patsubst % .cpp,% .o,$(wildcard $(ESPCOMP ) /nvs_flash/src/* .cpp) )
462
482
463
483
ESPIDF_SMARTCONFIG_ACK_O = $(patsubst % .c,% .o,$(wildcard $(ESPCOMP ) /smartconfig_ack/* .c) )
@@ -546,6 +566,29 @@ ESPIDF_ETHERNET_O = $(patsubst %.c,%.o,\
546
566
$(wildcard $(ESPCOMP ) /ethernet/* .c) \
547
567
$(wildcard $(ESPCOMP ) /ethernet/eth_phy/* .c) \
548
568
)
569
+
570
+ ifeq ($(CONFIG_NIMBLE_ENABLED ) ,y)
571
+ ESPIDF_BT_NIMBLE_O = $(patsubst % .c,% .o,\
572
+ $(wildcard $(ESPCOMP ) /bt/* .c) \
573
+ $(wildcard $(ESPCOMP ) /nimble/esp-hci/src/* .c) \
574
+ $(wildcard $(ESPCOMP ) /nimble/nimble/ext/tinycrypt/src/* .c) \
575
+ $(wildcard $(ESPCOMP ) /nimble/nimble/nimble/host/services/ans/src/* .c) \
576
+ $(wildcard $(ESPCOMP ) /nimble/nimble/nimble/host/services/bas/src/* .c) \
577
+ $(wildcard $(ESPCOMP ) /nimble/nimble/nimble/host/services/gap/src/* .c) \
578
+ $(wildcard $(ESPCOMP ) /nimble/nimble/nimble/host/services/gatt/src/* .c) \
579
+ $(wildcard $(ESPCOMP ) /nimble/nimble/nimble/host/services/ias/src/* .c) \
580
+ $(wildcard $(ESPCOMP ) /nimble/nimble/nimble/host/services/lls/src/* .c) \
581
+ $(wildcard $(ESPCOMP ) /nimble/nimble/nimble/host/services/tps/src/* .c) \
582
+ $(wildcard $(ESPCOMP ) /nimble/nimble/nimble/host/src/* .c) \
583
+ $(wildcard $(ESPCOMP ) /nimble/nimble/nimble/host/store/config/src/ble_store_config.c) \
584
+ $(wildcard $(ESPCOMP ) /nimble/nimble/nimble/host/store/config/src/ble_store_nvs.c) \
585
+ $(wildcard $(ESPCOMP ) /nimble/nimble/nimble/host/store/ram/src/* .c) \
586
+ $(wildcard $(ESPCOMP ) /nimble/nimble/nimble/host/util/src/* .c) \
587
+ $(wildcard $(ESPCOMP ) /nimble/nimble/nimble/src/* .c) \
588
+ $(wildcard $(ESPCOMP ) /nimble/nimble/porting/nimble/src/* .c) \
589
+ $(wildcard $(ESPCOMP ) /nimble/nimble/porting/npl/freertos/src/* .c) \
590
+ )
591
+ endif
549
592
endif
550
593
551
594
OBJ_ESPIDF =
@@ -587,14 +630,12 @@ $(eval $(call gen_espidf_lib_rule,mbedtls,$(ESPIDF_MBEDTLS_O)))
587
630
$(eval $(call gen_espidf_lib_rule,mdns,$(ESPIDF_MDNS_O)))
588
631
$(eval $(call gen_espidf_lib_rule,wpa_supplicant,$(ESPIDF_WPA_SUPPLICANT_O)))
589
632
$(eval $(call gen_espidf_lib_rule,sdmmc,$(ESPIDF_SDMMC_O)))
633
+ $(eval $(call gen_espidf_lib_rule,bt_nimble,$(ESPIDF_BT_NIMBLE_O)))
590
634
591
635
ifeq ($(ESPIDF_CURHASH ) ,$(ESPIDF_SUPHASH_V4 ) )
592
636
$(eval $(call gen_espidf_lib_rule,esp_common,$(ESPIDF_ESP_COMMON_O)))
593
637
$(eval $(call gen_espidf_lib_rule,esp_event,$(ESPIDF_ESP_EVENT_O)))
594
638
$(eval $(call gen_espidf_lib_rule,esp_wifi,$(ESPIDF_ESP_WIFI_O)))
595
- ifeq ($(CONFIG_BT_NIMBLE_ENABLED ) ,y)
596
- $(eval $(call gen_espidf_lib_rule,bt_nimble,$(ESPIDF_BT_NIMBLE_O)))
597
- endif
598
639
$(eval $(call gen_espidf_lib_rule,esp_eth,$(ESPIDF_ESP_ETH_O)))
599
640
$(eval $(call gen_espidf_lib_rule,xtensa,$(ESPIDF_XTENSA_O)))
600
641
else
@@ -714,6 +755,7 @@ APP_LD_ARGS += -L$(ESPCOMP)/bt/controller/lib -lbtdm_app
714
755
APP_LD_ARGS += -L$(ESPCOMP ) /esp_wifi/lib_esp32 -lcore -lmesh -lnet80211 -lphy -lrtc -lpp -lsmartconfig -lcoexist
715
756
else
716
757
APP_LD_ARGS += $(ESPCOMP ) /esp32/libhal.a
758
+ APP_LD_ARGS += -L$(ESPCOMP ) /bt/lib -lbtdm_app
717
759
APP_LD_ARGS += -L$(ESPCOMP ) /esp32/lib -lcore -lmesh -lnet80211 -lphy -lrtc -lpp -lwpa -lsmartconfig -lcoexist -lwps -lwpa2
718
760
endif
719
761
APP_LD_ARGS += $(OBJ )
@@ -769,6 +811,7 @@ BOOTLOADER_LIB_BOOTLOADER_SUPPORT_OBJ = $(addprefix $(BUILD)/bootloader/$(ESPCOM
769
811
bootloader_support/src/bootloader_clock.o \
770
812
bootloader_support/src/bootloader_common.o \
771
813
bootloader_support/src/bootloader_flash.o \
814
+ bootloader_support/src/bootloader_flash_config.o \
772
815
bootloader_support/src/bootloader_init.o \
773
816
bootloader_support/src/bootloader_random.o \
774
817
bootloader_support/src/bootloader_utility.o \
0 commit comments