Skip to content

Commit 5242027

Browse files
authored
Merge pull request SHA2017-badge#242 from SHA2017-badge/basvs-esp-idf-v3.1
Add support for esp-idf v3.1 framework.
2 parents 5dbf3e7 + 7c113ae commit 5242027

File tree

5 files changed

+317
-87
lines changed

5 files changed

+317
-87
lines changed

esp32/Makefile

Lines changed: 134 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,17 @@ INC += -I../../components/ed25519/include
5555
INC += -I../../components/redundancy
5656
INC += -I../../components/badge-first-run
5757
INC += -I../../components/png
58+
INC += -I../../components/audio_pipeline/include
59+
INC += -I../../components/audio_hal/board
60+
INC += -I../../components/audio_sal/include
61+
INC += -I../../components/audio_stream/include
62+
INC += -I../../components/esp_http_client/include
63+
INC += -I../../components/esp_http_client/lib/include
64+
INC += -I../../components/esp_peripherals/include
65+
INC += -I../../components/esp_peripherals/lib/blufi
66+
INC += -I../../components/tcp_transport/include
67+
INC += -I../../components/esp-adf-libs/esp_codec/include/codec
68+
INC += -I../../components/esp-tls
5869
INC += -I../../main
5970
INC += -I../../ugfx/src/gdisp/mcufont
6071
INC += -I../../ugfx
@@ -68,6 +79,7 @@ INC_ESPCOMP += -I$(ESPCOMP)/nghttp/port/include
6879
INC_ESPCOMP += -I$(ESPCOMP)/nghttp/nghttp2/lib/includes
6980
INC_ESPCOMP += -I$(ESPCOMP)/esp32/include
7081
INC_ESPCOMP += -I$(ESPCOMP)/soc/esp32/include
82+
INC_ESPCOMP += -I$(ESPCOMP)/smartconfig_ack/include
7183
INC_ESPCOMP += -I$(ESPCOMP)/ethernet/include
7284
INC_ESPCOMP += -I$(ESPCOMP)/expat/include/expat
7385
INC_ESPCOMP += -I$(ESPCOMP)/expat/port/include
@@ -81,7 +93,7 @@ INC_ESPCOMP += -I$(ESPCOMP)/tcpip_adapter/include
8193
INC_ESPCOMP += -I$(ESPCOMP)/lwip/include/lwip
8294
INC_ESPCOMP += -I$(ESPCOMP)/lwip/include/lwip/port
8395
INC_ESPCOMP += -I$(ESPCOMP)/lwip/include/lwip/posix
84-
INC_ESPCOMP += -I$(ESPCOMP)/mbedtls/include
96+
INC_ESPCOMP += -I$(ESPCOMP)/mbedtls/mbedtls/include
8597
INC_ESPCOMP += -I$(ESPCOMP)/mbedtls/port/include
8698
INC_ESPCOMP += -I$(ESPCOMP)/spi_flash/include
8799
INC_ESPCOMP += -I$(ESPCOMP)/wear_levelling/include
@@ -100,6 +112,7 @@ INC_ESPCOMP += -I$(ESPCOMP)/sdmmc/include
100112
INC_ESPCOMP += -I$(ESPCOMP)/heap/include
101113
INC_ESPCOMP += -I$(ESPCOMP)/soc/include
102114
INC_ESPCOMP += -I$(ESPCOMP)/fatfs/src
115+
INC_ESPCOMP += -I$(ESPCOMP)/pthread/include
103116

104117
CFLAGS_BASE = -std=gnu99 -Os -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -DMBEDTLS_CONFIG_FILE='"mbedtls/esp_config.h"' -DHAVE_CONFIG_H -DESP_PLATFORM
105118
CFLAGS = $(CFLAGS_BASE) $(INC) $(INC_ESPCOMP)
@@ -216,8 +229,8 @@ endif
216229
ifeq ($(MICROPY_NATIVEFS), 1)
217230
LIB_SRC_C += \
218231
$(ESPCOMP)/fatfs/src/ff.c \
232+
$(ESPCOMP)/fatfs/src/diskio_wl.c \
219233
$(ESPCOMP)/fatfs/src/diskio_sdmmc.c \
220-
$(ESPCOMP)/fatfs/src/diskio_spiflash.c \
221234
$(ESPCOMP)/fatfs/src/diskio.c \
222235
$(ESPCOMP)/fatfs/src/vfs_fat_sdmmc.c \
223236
$(ESPCOMP)/fatfs/src/vfs_fat_spiflash.c \
@@ -259,6 +272,7 @@ ESPIDF_DRIVER_O = $(addprefix $(ESPCOMP)/driver/,\
259272
sdmmc_host.o \
260273
sdmmc_transaction.o \
261274
sdspi_host.o \
275+
i2s.o \
262276
)
263277

264278
$(BUILD)/$(ESPCOMP)/esp32/dport_access.o: CFLAGS += -Wno-array-bounds
@@ -287,11 +301,13 @@ ESPIDF_ESP32_O = $(addprefix $(ESPCOMP)/esp32/,\
287301
brownout.o \
288302
fast_crypto_ops.o \
289303
wifi_init.o \
290-
wifi_internal.o \
304+
wifi_os_adapter.o \
291305
sleep_modes.o \
292306
esp_timer.o \
293307
esp_timer_esp32.o \
294308
ets_timer_legacy.o \
309+
esp_err_to_name.o \
310+
dbg_stubs.o \
295311
)
296312

297313
ESPIDF_PTHREAD_O = $(addprefix $(ESPCOMP)/pthread/,\
@@ -312,6 +328,9 @@ ESPIDF_SOC_O = $(addprefix $(ESPCOMP)/soc/,\
312328
esp32/rtc_pm.o \
313329
esp32/rtc_sleep.o \
314330
esp32/rtc_time.o \
331+
esp32/rtc_periph.o \
332+
esp32/spi_periph.o \
333+
esp32/gpio_periph.o \
315334
esp32/soc_memory_layout.o \
316335
)
317336

@@ -324,6 +343,10 @@ ESPIDF_ETHERNET_O = $(addprefix $(ESPCOMP)/ethernet/,\
324343
emac_main.o \
325344
)
326345

346+
ESPIDF_SMARTCONFIG_ACK_O = $(addprefix $(ESPCOMP)/smartconfig_ack/,\
347+
smartconfig_ack.o \
348+
)
349+
327350
ESPIDF_APP_TRACE_O = $(addprefix $(ESPCOMP)/app_trace/,\
328351
app_trace.o \
329352
)
@@ -334,6 +357,8 @@ ESPIDF_APP_UPDATE_O = $(addprefix $(ESPCOMP)/app_update/,\
334357

335358
ESPIDF_BOOTLOADER_O = $(addprefix $(ESPCOMP)/bootloader_support/src/,\
336359
esp_image_format.o \
360+
bootloader_init.o \
361+
bootloader_utility.o \
337362
bootloader_sha.o \
338363
bootloader_flash.o \
339364
)
@@ -410,6 +435,7 @@ ESPIDF_APP_TRACE_O = $(addprefix $(ESPCOMP)/app_trace/,\
410435

411436
ESPIDF_NEWLIB_O = $(addprefix $(ESPCOMP)/newlib/,\
412437
time.o \
438+
select.o \
413439
syscalls.o \
414440
syscall_table.o \
415441
reent_init.o \
@@ -443,6 +469,7 @@ ESPIDF_NGHTTP_O = $(addprefix $(ESPCOMP)/nghttp/,\
443469

444470
ESPIDF_NVS_FLASH_O = $(addprefix $(ESPCOMP)/nvs_flash/,\
445471
src/nvs_types.o \
472+
src/nvs_ops.o \
446473
src/nvs_page.o \
447474
src/nvs_item_hash_list.o \
448475
src/nvs_pagemanager.o \
@@ -531,75 +558,77 @@ ESPIDF_LWIP_O = $(addprefix $(ESPCOMP)/lwip/,\
531558
)
532559

533560
ESPIDF_MBEDTLS_O = $(addprefix $(ESPCOMP)/mbedtls/,\
534-
library/entropy.o \
535-
library/pkcs12.o \
536-
library/ccm.o \
537-
library/pk.o \
538-
library/sha1.o \
539-
library/x509_csr.o \
540-
library/ssl_cli.o \
541-
library/ecp.o \
542-
library/blowfish.o \
543-
library/x509.o \
544-
library/ecp_curves.o \
545-
library/error.o \
546-
library/ssl_ticket.o \
547-
library/entropy_poll.o \
548-
library/cipher.o \
549-
library/version_features.o \
550-
library/ripemd160.o \
551-
library/rsa.o \
552-
library/md.o \
553-
library/md_wrap.o \
554-
library/sha256.o \
555-
library/dhm.o \
556-
library/ssl_cache.o \
557-
library/pkwrite.o \
558-
library/base64.o \
559-
library/asn1parse.o \
560-
library/ssl_tls.o \
561-
library/hmac_drbg.o \
562-
library/pem.o \
563-
library/version.o \
564-
library/gcm.o \
565-
library/memory_buffer_alloc.o \
566-
library/md2.o \
567-
library/ecdsa.o \
568-
library/ssl_srv.o \
569-
library/x509_crt.o \
570-
library/ecdh.o \
571-
library/asn1write.o \
572-
library/md4.o \
573-
library/debug.o \
574-
library/x509_create.o \
575-
library/ecjpake.o \
576-
library/oid.o \
577-
library/md5.o \
578-
library/ssl_ciphersuites.o \
579-
library/sha512.o \
580-
library/xtea.o \
581-
library/aes.o \
582-
library/cipher_wrap.o \
583-
library/arc4.o \
584-
library/bignum.o \
585-
library/pkparse.o \
586-
library/padlock.o \
587-
library/threading.o \
588-
library/x509_crl.o \
589-
library/pkcs11.o \
590-
library/aesni.o \
591-
library/timing.o \
592-
library/certs.o \
593-
library/pkcs5.o \
594-
library/ssl_cookie.o \
595-
library/camellia.o \
596-
library/havege.o \
597-
library/des.o \
598-
library/x509write_csr.o \
599-
library/platform.o \
600-
library/ctr_drbg.o \
601-
library/x509write_crt.o \
602-
library/pk_wrap.o \
561+
mbedtls/library/entropy.o \
562+
mbedtls/library/pkcs12.o \
563+
mbedtls/library/ccm.o \
564+
mbedtls/library/pk.o \
565+
mbedtls/library/sha1.o \
566+
mbedtls/library/x509_csr.o \
567+
mbedtls/library/ssl_cli.o \
568+
mbedtls/library/ecp.o \
569+
mbedtls/library/blowfish.o \
570+
mbedtls/library/x509.o \
571+
mbedtls/library/ecp_curves.o \
572+
mbedtls/library/error.o \
573+
mbedtls/library/ssl_ticket.o \
574+
mbedtls/library/entropy_poll.o \
575+
mbedtls/library/cipher.o \
576+
mbedtls/library/version_features.o \
577+
mbedtls/library/ripemd160.o \
578+
mbedtls/library/rsa.o \
579+
mbedtls/library/rsa_internal.o \
580+
mbedtls/library/md.o \
581+
mbedtls/library/md_wrap.o \
582+
mbedtls/library/sha256.o \
583+
mbedtls/library/dhm.o \
584+
mbedtls/library/ssl_cache.o \
585+
mbedtls/library/pkwrite.o \
586+
mbedtls/library/base64.o \
587+
mbedtls/library/asn1parse.o \
588+
mbedtls/library/ssl_tls.o \
589+
mbedtls/library/hmac_drbg.o \
590+
mbedtls/library/pem.o \
591+
mbedtls/library/version.o \
592+
mbedtls/library/gcm.o \
593+
mbedtls/library/memory_buffer_alloc.o \
594+
mbedtls/library/md2.o \
595+
mbedtls/library/ecdsa.o \
596+
mbedtls/library/ssl_srv.o \
597+
mbedtls/library/x509_crt.o \
598+
mbedtls/library/ecdh.o \
599+
mbedtls/library/asn1write.o \
600+
mbedtls/library/md4.o \
601+
mbedtls/library/debug.o \
602+
mbedtls/library/x509_create.o \
603+
mbedtls/library/ecjpake.o \
604+
mbedtls/library/oid.o \
605+
mbedtls/library/md5.o \
606+
mbedtls/library/ssl_ciphersuites.o \
607+
mbedtls/library/sha512.o \
608+
mbedtls/library/xtea.o \
609+
mbedtls/library/aes.o \
610+
mbedtls/library/cipher_wrap.o \
611+
mbedtls/library/arc4.o \
612+
mbedtls/library/bignum.o \
613+
mbedtls/library/pkparse.o \
614+
mbedtls/library/padlock.o \
615+
mbedtls/library/threading.o \
616+
mbedtls/library/x509_crl.o \
617+
mbedtls/library/pkcs11.o \
618+
mbedtls/library/aesni.o \
619+
mbedtls/library/timing.o \
620+
mbedtls/library/certs.o \
621+
mbedtls/library/pkcs5.o \
622+
mbedtls/library/ssl_cookie.o \
623+
mbedtls/library/camellia.o \
624+
mbedtls/library/havege.o \
625+
mbedtls/library/des.o \
626+
mbedtls/library/x509write_csr.o \
627+
mbedtls/library/platform.o \
628+
mbedtls/library/platform_util.o \
629+
mbedtls/library/ctr_drbg.o \
630+
mbedtls/library/x509write_crt.o \
631+
mbedtls/library/pk_wrap.o \
603632
port/net_sockets.o \
604633
port/esp_bignum.o \
605634
port/esp_hardware.o \
@@ -608,7 +637,7 @@ ESPIDF_MBEDTLS_O = $(addprefix $(ESPCOMP)/mbedtls/,\
608637
port/esp_sha512.o \
609638
)
610639

611-
$(BUILD)/$(ESPCOMP)/wpa_supplicant/%.o: CFLAGS += -DEMBEDDED_SUPP -D__ets__ -Wno-strict-aliasing
640+
$(BUILD)/$(ESPCOMP)/wpa_supplicant/%.o: CFLAGS += -DESPRESSIF_USE -DEMBEDDED_SUPP -D__ets__ -Wno-strict-aliasing
612641
ESPIDF_WPA_SUPPLICANT_O = $(addprefix $(ESPCOMP)/wpa_supplicant/,\
613642
src/crypto/aes-internal-enc.o \
614643
src/crypto/sha256-internal.o \
@@ -638,6 +667,27 @@ ESPIDF_WPA_SUPPLICANT_O = $(addprefix $(ESPCOMP)/wpa_supplicant/,\
638667
port/os_xtensa.o \
639668
)
640669

670+
ESPADF_O = $(addprefix $(PROJECT_PATH)/components/,\
671+
audio_pipeline/audio_pipeline.o \
672+
audio_pipeline/audio_element.o \
673+
audio_pipeline/audio_event_iface.o \
674+
audio_pipeline/ringbuf.o \
675+
audio_sal/audio_mem.o \
676+
audio_stream/http_stream.o \
677+
audio_stream/i2s_stream.o \
678+
esp_http_client/esp_http_client.o \
679+
esp_http_client/lib/http_header.o \
680+
esp_http_client/lib/http_auth.o \
681+
esp_http_client/lib/http_utils.o \
682+
tcp_transport/transport.o \
683+
tcp_transport/transport_ssl.o \
684+
tcp_transport/transport_tcp.o \
685+
tcp_transport/transport_utils.o \
686+
esp-tls/esp_tls.o \
687+
esp_peripherals/periph_wifi.o \
688+
esp_peripherals/esp_peripherals.o \
689+
)
690+
641691
OBJ_ESPIDF =
642692
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_NEWLIB_O))
643693
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_DRIVER_O))
@@ -647,6 +697,7 @@ OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_HEAP_O))
647697
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_SOC_O))
648698
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_CXX_O))
649699
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_ETHERNET_O))
700+
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_SMARTCONFIG_ACK_O))
650701
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_APP_TRACE_O))
651702
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_EXPAT_O))
652703
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_FREERTOS_O))
@@ -667,6 +718,7 @@ OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_WPA_SUPPLICANT_O))
667718
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_APP_UPDATE_O))
668719
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_BOOTLOADER_O))
669720
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_SDMMC_O))
721+
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPADF_O))
670722

671723
####################
672724
# Badge magic
@@ -759,8 +811,9 @@ APP_LD_ARGS += -lgcov
759811
APP_LD_ARGS += $(ESPCOMP)/newlib/lib/libc.a
760812
APP_LD_ARGS += $(ESPCOMP)/newlib/lib/libm.a
761813
APP_LD_ARGS += $(ESPCOMP)/esp32/libhal.a
814+
APP_LD_ARGS += $(PROJECT_PATH)/components/esp-adf-libs/esp_codec/lib/libesp_codec.a
762815
APP_LD_ARGS += $(BADGE_LIBS)
763-
APP_LD_ARGS += -L$(ESPCOMP)/esp32/lib -lcore -lnet80211 -lphy -lrtc -lpp -lwpa -lwpa2 -lwps -lsmartconfig -lcoexist
816+
APP_LD_ARGS += -L$(ESPCOMP)/esp32/lib -lcore -lnet80211 -lmesh -lphy -lrtc -lpp -lwpa -lwpa2 -lwps -lsmartconfig -lcoexist
764817
APP_LD_ARGS += $(OBJ)
765818
APP_LD_ARGS += --end-group
766819

@@ -801,16 +854,22 @@ BOOTLOADER_OBJ = $(addprefix $(BUILD)/bootloader/$(ESPCOMP)/,\
801854
bootloader_support/src/bootloader_sha.o \
802855
bootloader_support/src/bootloader_random.o \
803856
bootloader_support/src/bootloader_clock.o \
857+
bootloader_support/src/bootloader_init.o \
858+
bootloader_support/src/bootloader_utility.o \
859+
bootloader_support/src/bootloader_common.o \
804860
bootloader_support/src/secure_boot_signatures.o \
805861
bootloader_support/src/secure_boot.o \
806862
bootloader_support/src/esp_image_format.o \
807863
bootloader_support/src/flash_encrypt.o \
808864
bootloader_support/src/flash_partitions.o \
865+
bootloader_support/src/flash_qio_mode.o \
809866
log/log.o \
810867
spi_flash/spi_flash_rom_patch.o \
868+
soc/esp32/cpu_util.o \
811869
soc/esp32/rtc_clk.o \
812870
soc/esp32/rtc_time.o \
813871
soc/esp32/rtc_init.o \
872+
soc/esp32/rtc_periph.o \
814873
micro-ecc/micro-ecc/uECC.o \
815874
bootloader/subproject/main/bootloader_start.o \
816875
)
@@ -835,6 +894,7 @@ BOOTLOADER_LDFLAGS += -T $(ESPCOMP)/bootloader/subproject/main/esp32.bootloader.
835894
BOOTLOADER_LDFLAGS += -T $(ESPCOMP)/bootloader/subproject/main/esp32.bootloader.rom.ld
836895
BOOTLOADER_LDFLAGS += -T $(ESPCOMP)/esp32/ld/esp32.rom.ld
837896
BOOTLOADER_LDFLAGS += -T $(ESPCOMP)/esp32/ld/esp32.rom.spiram_incompatible_fns.ld
897+
BOOTLOADER_LDFLAGS += -T $(ESPCOMP)/esp32/ld/esp32.peripherals.ld
838898

839899
BOOTLOADER_OBJ_DIRS = $(sort $(dir $(BOOTLOADER_OBJ)))
840900
$(BOOTLOADER_OBJ): | $(BOOTLOADER_OBJ_DIRS)

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