@@ -78,10 +78,19 @@ INC += -Iesp-idf/components/freertos/xtensa/include
78
78
INC += -Iesp-idf/components/esp32s2/include
79
79
INC += -Iesp-idf/components/xtensa/esp32s2/include
80
80
INC += -Iesp-idf/components/esp_common/include
81
+ INC += -Iesp-idf/components/esp_event/include
82
+ INC += -Iesp-idf/components/esp_netif/include
81
83
INC += -Iesp-idf/components/esp_ringbuf/include
82
84
INC += -Iesp-idf/components/esp_rom/include
85
+ INC += -Iesp-idf/components/esp_wifi/include
83
86
INC += -Iesp-idf/components/xtensa/include
84
87
INC += -Iesp-idf/components/esp_timer/include
88
+ INC += -Iesp-idf/components/mbedtls/mbedtls/include
89
+ INC += -Iesp-idf/components/mbedtls/port/include/
90
+ INC += -Iesp-idf/components/newlib/platform_include
91
+ INC += -Iesp-idf/components/lwip/lwip/src/include
92
+ INC += -Iesp-idf/components/lwip/port/esp32/include
93
+ INC += -Iesp-idf/components/lwip/include/apps/sntp
85
94
INC += -Iesp-idf/components/soc/include
86
95
INC += -Iesp-idf/components/soc/src/esp32s2/include
87
96
INC += -Iesp-idf/components/soc/soc/include
@@ -125,11 +134,12 @@ LDFLAGS += -L$(BUILD)/esp-idf/esp-idf/esp32s2 \
125
134
-Tesp32s2.peripherals.ld \
126
135
-Lesp-idf/components/esp_rom/esp32s2/ld \
127
136
-Tesp32s2.rom.ld \
137
+ -Tesp32s2.rom.api.ld \
128
138
-Tesp32s2.rom.libgcc.ld \
129
139
-Tesp32s2.rom.newlib-data.ld \
130
140
-Tesp32s2.rom.newlib-funcs.ld \
131
141
-Tesp32s2.rom.spiflash.ld
132
- LIBS := -lgcc -lc
142
+ LIBS := -lgcc -lc -lstdc++
133
143
134
144
#
135
145
@@ -156,6 +166,7 @@ SRC_C += \
156
166
background.c \
157
167
fatfs_port.c \
158
168
mphalport.c \
169
+ bindings/espidf/__init__.c \
159
170
boards/$(BOARD ) /board.c \
160
171
boards/$(BOARD ) /pins.c \
161
172
modules/$(CIRCUITPY_MODULE ) .c \
@@ -238,20 +249,25 @@ $(BUILD)/esp-idf/partition_table/partition-table.bin: $(BUILD)/esp-idf/config/sd
238
249
239
250
# run menuconfig
240
251
menuconfig : $(BUILD ) /esp-idf/config
241
- ninja -C $(BUILD ) /esp-idf menuconfig
242
- diff --old-line-format= --unchanged-line-format= sdkconfig.defaults $(BUILD ) /esp-idf/sdkconfig > boards/$(BOARD ) /sdkconfig || true
252
+ $( Q ) ninja -C $(BUILD ) /esp-idf menuconfig
253
+ $( Q ) diff --old-line-format= --unchanged-line-format= sdkconfig.defaults $(BUILD ) /esp-idf/sdkconfig > boards/$(BOARD ) /sdkconfig || true
243
254
244
255
# qstr builds include headers so we need to make sure they are up to date
245
256
$(HEADER_BUILD ) /qstr.i.last : | $(BUILD ) /esp-idf/config/sdkconfig.h
246
257
247
258
# Order here matters
248
- ESP_IDF_COMPONENTS_LINK = freertos log esp_system esp32s2 bootloader_support pthread esp_timer vfs spi_flash app_update esp_common esp32s2 heap newlib driver xtensa soc esp_ringbuf #
259
+ ESP_IDF_COMPONENTS_LINK = freertos log esp_system esp32s2 bootloader_support pthread esp_timer vfs spi_flash app_update esp_common esp32s2 heap newlib driver xtensa soc esp_ringbuf esp_wifi esp_event wpa_supplicant mbedtls efuse nvs_flash esp_netif lwip esp_rom esp-tls
249
260
250
261
ESP_IDF_COMPONENTS_INCLUDE = driver freertos log soc
251
262
252
263
INC += $(foreach component, $(ESP_IDF_COMPONENTS_INCLUDE ) , -Iesp-idf/components/$(component ) /include)
253
264
254
265
ESP_IDF_COMPONENTS_EXPANDED = $(foreach component, $(ESP_IDF_COMPONENTS_LINK ) , $(BUILD ) /esp-idf/esp-idf/$(component ) /lib$(component ) .a)
266
+ ESP_IDF_WIFI_COMPONENTS_EXPANDED = $(foreach component, $(ESP_IDF_WIFI_COMPONENTS_LINK ) , $(BUILD ) /esp-idf/esp-idf/$(component ) /lib$(component ) .a)
267
+
268
+ MBEDTLS_COMPONENTS_LINK = crypto tls x509
269
+ MBEDTLS_COMPONENTS_LINK_EXPANDED = $(foreach component, $(MBEDTLS_COMPONENTS_LINK ) , $(BUILD ) /esp-idf/esp-idf/mbedtls/mbedtls/library/libmbed$(component ) .a)
270
+
255
271
BINARY_BLOBS = esp-idf/components/xtensa/esp32s2/libhal.a
256
272
BINARY_WIFI_BLOBS = libcoexist.a libcore.a libespnow.a libmesh.a libnet80211.a libpp.a librtc.a libsmartconfig.a libphy.a
257
273
BINARY_BLOBS += $(addprefix esp-idf/components/esp_wifi/lib/esp32s2/, $(BINARY_WIFI_BLOBS ) )
@@ -265,18 +281,27 @@ all: $(BUILD)/firmware.bin $(BUILD)/firmware.uf2
265
281
266
282
.PHONY : esp-idf-stamp
267
283
esp-idf-stamp : $(BUILD ) /esp-idf/config/sdkconfig.h
268
- ninja -C $(BUILD ) /esp-idf \
284
+ $( Q ) ninja -C $(BUILD ) /esp-idf \
269
285
bootloader/bootloader.bin \
270
286
esp-idf/bootloader_support/libbootloader_support.a \
287
+ esp-idf/esp-tls/libesp-tls.a \
271
288
esp-idf/esp32s2/ld/esp32s2.project.ld \
289
+ esp-idf/esp_event/libesp_event.a \
290
+ esp-idf/esp_netif/libesp_netif.a \
291
+ esp-idf/esp_rom/libesp_rom.a \
272
292
esp-idf/esp_system/libesp_system.a \
293
+ esp-idf/esp_wifi/libesp_wifi.a \
294
+ esp-idf/lwip/liblwip.a \
295
+ esp-idf/nvs_flash/libnvs_flash.a \
296
+ esp-idf/wpa_supplicant/libwpa_supplicant.a \
297
+ esp-idf/mbedtls/libmbedtls.a \
273
298
esp-idf/freertos/libfreertos.a \
274
299
esp-idf/log/liblog.a \
275
300
esp-idf/xtensa/libxtensa.a
276
301
277
302
$(BUILD ) /firmware.elf : $(OBJ ) | esp-idf-stamp
278
303
$(STEPECHO ) " LINK $@ "
279
- $(Q )$(CC ) -o $@ $(LDFLAGS ) $^ $(ESP_IDF_COMPONENTS_EXPANDED ) $(BINARY_BLOBS ) build-$(BOARD ) /esp-idf/esp-idf/newlib/libnewlib.a - u newlib_include_pthread_impl -Wl,--start-group $(LIBS ) -Wl,--end-group
304
+ $(Q )$(CC ) -o $@ $(LDFLAGS ) $^ -Wl,--start-group $(ESP_IDF_COMPONENTS_EXPANDED ) $(BINARY_BLOBS ) $( MBEDTLS_COMPONENTS_LINK_EXPANDED ) build-$(BOARD ) /esp-idf/esp-idf/newlib/libnewlib.a -Wl,--end-group - u newlib_include_pthread_impl -Wl,--start-group $(LIBS ) -Wl,--end-group build- $( BOARD ) /esp-idf/esp-idf/pthread/libpthread.a -u __cxx_fatal_exception
280
305
# $(Q)$(SIZE) $@ | $(PYTHON3) $(TOP)/tools/build_memory_info.py $(BUILD)/esp-idf/esp-idf/esp32s2/esp32s2_out.ld
281
306
282
307
$(BUILD ) /circuitpython-firmware.bin : $(BUILD ) /firmware.elf
0 commit comments