@@ -59,12 +59,12 @@ include $(TOP)/supervisor/supervisor.mk
59
59
# Include make rules and variables common across CircuitPython builds.
60
60
include $(TOP ) /py/circuitpy_defns.mk
61
61
62
- ifeq ($(IDF_TARGET ) ,esp32s2)
63
- IDF_TARGET_ARCH = xtensa
64
- CROSS_COMPILE = xtensa-$(IDF_TARGET ) -elf-
65
- else ifeq ($(IDF_TARGET),esp32c3)
62
+ ifeq ($(IDF_TARGET ) ,esp32c3)
66
63
IDF_TARGET_ARCH = riscv
67
64
CROSS_COMPILE = riscv32-esp-elf-
65
+ else
66
+ IDF_TARGET_ARCH = xtensa
67
+ CROSS_COMPILE = xtensa-$(IDF_TARGET ) -elf-
68
68
endif
69
69
70
70
# ######################################
@@ -92,6 +92,7 @@ INC += -I.\
92
92
-isystem esp-idf/components/esp_common/include \
93
93
-isystem esp-idf/components/esp_event/include \
94
94
-isystem esp-idf/components/esp_hw_support/include \
95
+ -isystem esp-idf/components/esp_hw_support/include/soc \
95
96
-isystem esp-idf/components/esp_netif/include \
96
97
-isystem esp-idf/components/esp_pm/include \
97
98
-isystem esp-idf/components/esp_ringbuf/include \
@@ -101,6 +102,8 @@ INC += -I.\
101
102
-isystem esp-idf/components/esp_wifi/include \
102
103
-isystem esp-idf/components/freertos/include \
103
104
-isystem esp-idf/components/freertos/include/freertos \
105
+ -isystem esp-idf/components/freertos/include/esp_additions \
106
+ -isystem esp-idf/components/freertos/include/esp_additions/freertos \
104
107
-isystem esp-idf/components/freertos/port/$(IDF_TARGET_ARCH ) /include \
105
108
-isystem esp-idf/components/hal/include \
106
109
-isystem esp-idf/components/hal/$(IDF_TARGET ) /include \
@@ -158,12 +161,11 @@ endif
158
161
159
162
LDFLAGS = $(CFLAGS ) -Wl,-nostdlib -Wl,-Map=$@ .map -Wl,-cref -Wl,--undefined=uxTopUsedPriority
160
163
161
- LDFLAGS += -L$(BUILD ) /esp-idf/esp-idf/$(IDF_TARGET ) \
162
- -L$(BUILD ) /esp-idf/esp-idf/$(IDF_TARGET ) /ld \
163
- -Lesp-idf/components/$(IDF_TARGET ) /ld \
164
+ LDFLAGS += -L$(BUILD ) /esp-idf/esp-idf/esp_system/ld \
164
165
-Lesp-idf/components/esp_rom/$(IDF_TARGET ) /ld \
165
- -T$(IDF_TARGET ) _out.ld \
166
- -T$(IDF_TARGET ) .project.ld \
166
+ -Lesp-idf/components/soc/$(IDF_TARGET ) /ld \
167
+ -Tmemory.ld \
168
+ -Tsections.ld \
167
169
-T$(IDF_TARGET ) .peripherals.ld \
168
170
-T$(IDF_TARGET ) .rom.ld \
169
171
-T$(IDF_TARGET ) .rom.api.ld \
@@ -174,10 +176,13 @@ ifeq ($(IDF_TARGET),esp32c3)
174
176
LDFLAGS += -Tesp32c3.rom.newlib.ld \
175
177
-Tesp32c3.rom.version.ld \
176
178
-Tesp32c3.rom.eco3.ld
177
- else
179
+ else ifeq ($(IDF_TARGET),esp32s2)
178
180
LDFLAGS += -T$(IDF_TARGET ) .rom.newlib-data.ld \
179
181
-T$(IDF_TARGET ) .rom.newlib-funcs.ld \
180
182
-T$(IDF_TARGET ) .rom.spiflash.ld
183
+ else ifeq ($(IDF_TARGET),esp32s3)
184
+ LDFLAGS += -Tesp32s3.rom.newlib.ld \
185
+ -Tesp32s3.rom.version.ld
181
186
endif
182
187
183
188
LDFLAGS += -Wl,-Bstatic \
@@ -224,10 +229,14 @@ SRC_C += \
224
229
peripherals/timer.c \
225
230
peripherals/$(IDF_TARGET ) /pins.c
226
231
227
- ifneq ($(IDF_TARGET ) ,esp32c3 )
232
+ ifeq ($(IDF_TARGET ) ,esp32s2 )
228
233
SRC_C += \
229
234
cam.c \
230
- i2s_lcd_esp32s2_driver.c \
235
+ i2s_lcd_esp32s2_driver.c
236
+ endif
237
+
238
+ ifneq ($(IDF_TARGET ) ,esp32c3)
239
+ SRC_C += \
231
240
peripherals/pcnt.c \
232
241
peripherals/touch.c
233
242
endif
@@ -315,20 +324,15 @@ menuconfig: $(BUILD)/esp-idf/config
315
324
# qstr builds include headers so we need to make sure they are up to date
316
325
$(HEADER_BUILD ) /qstr.split : | $(BUILD ) /esp-idf/config/sdkconfig.h
317
326
318
- ESP_IDF_COMPONENTS_LINK = $(IDF_TARGET ) $(IDF_TARGET_ARCH ) app_update bootloader_support driver efuse esp_adc_cal esp_common esp_event esp_hw_support esp_netif esp_pm esp_ringbuf esp_rom esp_system esp_timer esp-tls esp_wifi freertos hal heap log lwip mbedtls newlib nvs_flash pthread soc spi_flash vfs wpa_supplicant
327
+ BINARY_WIFI_BLOBS = libcoexist.a libcore.a libespnow.a libmesh.a libnet80211.a libpp.a libsmartconfig.a libwapi.a
328
+ BINARY_BLOBS = esp-idf/components/esp_phy/lib/$(IDF_TARGET ) /libphy.a $(addprefix esp-idf/components/esp_wifi/lib/$(IDF_TARGET ) /, $(BINARY_WIFI_BLOBS ) )
319
329
330
+ ESP_IDF_COMPONENTS_LINK = $(IDF_TARGET_ARCH ) app_update bootloader_support driver efuse esp_adc_cal esp_common esp_event esp_hw_support esp_ipc esp_netif esp_pm esp_phy esp_ringbuf esp_rom esp_system esp_timer esp-tls esp_wifi freertos hal heap log lwip mbedtls newlib nvs_flash pthread soc spi_flash vfs wpa_supplicant
320
331
ESP_IDF_COMPONENTS_EXPANDED = $(foreach component, $(ESP_IDF_COMPONENTS_LINK ) , $(BUILD ) /esp-idf/esp-idf/$(component ) /lib$(component ) .a)
321
- ESP_IDF_WIFI_COMPONENTS_EXPANDED = $(foreach component, $(ESP_IDF_WIFI_COMPONENTS_LINK ) , $(BUILD ) /esp-idf/esp-idf/$(component ) /lib$(component ) .a)
322
332
323
333
MBEDTLS_COMPONENTS_LINK = crypto tls x509
324
334
MBEDTLS_COMPONENTS_LINK_EXPANDED = $(foreach component, $(MBEDTLS_COMPONENTS_LINK ) , $(BUILD ) /esp-idf/esp-idf/mbedtls/mbedtls/library/libmbed$(component ) .a)
325
335
326
- BINARY_WIFI_BLOBS = libcoexist.a libcore.a libespnow.a libmesh.a libnet80211.a libpp.a libsmartconfig.a libphy.a
327
- ifneq ($(IDF_TARGET ) ,esp32c3)
328
- BINARY_WIFI_BLOBS += librtc.a
329
- endif
330
- BINARY_BLOBS = $(addprefix esp-idf/components/esp_wifi/lib/$(IDF_TARGET ) /, $(BINARY_WIFI_BLOBS ) )
331
-
332
336
ifeq ($(IDF_TARGET_ARCH ) ,xtensa)
333
337
BINARY_BLOBS += esp-idf/components/xtensa/$(IDF_TARGET ) /libxt_hal.a
334
338
ESP_IDF_COMPONENTS_EXPANDED += esp-idf/components/xtensa/$(IDF_TARGET ) /libxt_hal.a
@@ -360,17 +364,18 @@ endif
360
364
esp-idf-stamp : $(BUILD ) /esp-idf/config/sdkconfig.h
361
365
$(Q ) ninja -C $(BUILD ) /esp-idf \
362
366
bootloader/bootloader.bin \
367
+ esp-idf/esp_system/__ldgen_output_sections.ld \
363
368
esp-idf/app_update/libapp_update.a \
364
369
esp-idf/bootloader_support/libbootloader_support.a \
365
370
esp-idf/driver/libdriver.a \
366
371
esp-idf/efuse/libefuse.a \
367
- esp-idf/$(IDF_TARGET ) /lib$(IDF_TARGET ) .a \
368
- esp-idf/$(IDF_TARGET ) /ld/$(IDF_TARGET ) .project.ld \
369
372
esp-idf/esp_adc_cal/libesp_adc_cal.a \
370
373
esp-idf/esp_common/libesp_common.a \
371
374
esp-idf/esp_event/libesp_event.a \
372
375
esp-idf/esp_hw_support/libesp_hw_support.a \
376
+ esp-idf/esp_ipc/libesp_ipc.a \
373
377
esp-idf/esp_netif/libesp_netif.a \
378
+ esp-idf/esp_phy/libesp_phy.a \
374
379
esp-idf/esp_pm/libesp_pm.a \
375
380
esp-idf/esp_ringbuf/libesp_ringbuf.a \
376
381
esp-idf/esp_rom/libesp_rom.a \
0 commit comments