Skip to content
This repository was archived by the owner on Aug 2, 2020. It is now read-only.

Commit 02f074a

Browse files
author
Bas van Sisseren
committed
Add support for esp-idf v3.1 framework.
1 parent 4cec21a commit 02f074a

File tree

3 files changed

+147
-85
lines changed

3 files changed

+147
-85
lines changed

esp32/Makefile

Lines changed: 100 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ INC_ESPCOMP += -I$(ESPCOMP)/nghttp/port/include
105105
INC_ESPCOMP += -I$(ESPCOMP)/nghttp/nghttp2/lib/includes
106106
INC_ESPCOMP += -I$(ESPCOMP)/esp32/include
107107
INC_ESPCOMP += -I$(ESPCOMP)/soc/esp32/include
108+
INC_ESPCOMP += -I$(ESPCOMP)/smartconfig_ack/include
108109
INC_ESPCOMP += -I$(ESPCOMP)/ethernet/include
109110
INC_ESPCOMP += -I$(ESPCOMP)/expat/include/expat
110111
INC_ESPCOMP += -I$(ESPCOMP)/expat/port/include
@@ -118,7 +119,7 @@ INC_ESPCOMP += -I$(ESPCOMP)/tcpip_adapter/include
118119
INC_ESPCOMP += -I$(ESPCOMP)/lwip/include/lwip
119120
INC_ESPCOMP += -I$(ESPCOMP)/lwip/include/lwip/port
120121
INC_ESPCOMP += -I$(ESPCOMP)/lwip/include/lwip/posix
121-
INC_ESPCOMP += -I$(ESPCOMP)/mbedtls/include
122+
INC_ESPCOMP += -I$(ESPCOMP)/mbedtls/mbedtls/include
122123
INC_ESPCOMP += -I$(ESPCOMP)/mbedtls/port/include
123124
INC_ESPCOMP += -I$(ESPCOMP)/spi_flash/include
124125
INC_ESPCOMP += -I$(ESPCOMP)/wear_levelling/include
@@ -137,6 +138,7 @@ INC_ESPCOMP += -I$(ESPCOMP)/sdmmc/include
137138
INC_ESPCOMP += -I$(ESPCOMP)/heap/include
138139
INC_ESPCOMP += -I$(ESPCOMP)/soc/include
139140
INC_ESPCOMP += -I$(ESPCOMP)/fatfs/src
141+
INC_ESPCOMP += -I$(ESPCOMP)/pthread/include
140142

141143
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
142144
CFLAGS = $(CFLAGS_BASE) $(INC) $(INC_ESPCOMP)
@@ -242,8 +244,8 @@ endif
242244
ifeq ($(MICROPY_NATIVEFS), 1)
243245
LIB_SRC_C += \
244246
$(ESPCOMP)/fatfs/src/ff.c \
247+
$(ESPCOMP)/fatfs/src/diskio_wl.c \
245248
$(ESPCOMP)/fatfs/src/diskio_sdmmc.c \
246-
$(ESPCOMP)/fatfs/src/diskio_spiflash.c \
247249
$(ESPCOMP)/fatfs/src/diskio.c \
248250
$(ESPCOMP)/fatfs/src/vfs_fat_sdmmc.c \
249251
$(ESPCOMP)/fatfs/src/vfs_fat_spiflash.c \
@@ -285,6 +287,7 @@ ESPIDF_DRIVER_O = $(addprefix $(ESPCOMP)/driver/,\
285287
sdmmc_host.o \
286288
sdmmc_transaction.o \
287289
sdspi_host.o \
290+
i2s.o \
288291
)
289292

290293
$(BUILD)/$(ESPCOMP)/esp32/dport_access.o: CFLAGS += -Wno-array-bounds
@@ -313,11 +316,13 @@ ESPIDF_ESP32_O = $(addprefix $(ESPCOMP)/esp32/,\
313316
brownout.o \
314317
fast_crypto_ops.o \
315318
wifi_init.o \
316-
wifi_internal.o \
319+
wifi_os_adapter.o \
317320
sleep_modes.o \
318321
esp_timer.o \
319322
esp_timer_esp32.o \
320323
ets_timer_legacy.o \
324+
esp_err_to_name.o \
325+
dbg_stubs.o \
321326
)
322327

323328
ESPIDF_PTHREAD_O = $(addprefix $(ESPCOMP)/pthread/,\
@@ -338,6 +343,9 @@ ESPIDF_SOC_O = $(addprefix $(ESPCOMP)/soc/,\
338343
esp32/rtc_pm.o \
339344
esp32/rtc_sleep.o \
340345
esp32/rtc_time.o \
346+
esp32/rtc_periph.o \
347+
esp32/spi_periph.o \
348+
esp32/gpio_periph.o \
341349
esp32/soc_memory_layout.o \
342350
)
343351

@@ -350,6 +358,10 @@ ESPIDF_ETHERNET_O = $(addprefix $(ESPCOMP)/ethernet/,\
350358
emac_main.o \
351359
)
352360

361+
ESPIDF_SMARTCONFIG_ACK_O = $(addprefix $(ESPCOMP)/smartconfig_ack/,\
362+
smartconfig_ack.o \
363+
)
364+
353365
ESPIDF_APP_TRACE_O = $(addprefix $(ESPCOMP)/app_trace/,\
354366
app_trace.o \
355367
)
@@ -360,6 +372,8 @@ ESPIDF_APP_UPDATE_O = $(addprefix $(ESPCOMP)/app_update/,\
360372

361373
ESPIDF_BOOTLOADER_O = $(addprefix $(ESPCOMP)/bootloader_support/src/,\
362374
esp_image_format.o \
375+
bootloader_init.o \
376+
bootloader_utility.o \
363377
bootloader_sha.o \
364378
bootloader_flash.o \
365379
)
@@ -436,6 +450,7 @@ ESPIDF_APP_TRACE_O = $(addprefix $(ESPCOMP)/app_trace/,\
436450

437451
ESPIDF_NEWLIB_O = $(addprefix $(ESPCOMP)/newlib/,\
438452
time.o \
453+
select.o \
439454
syscalls.o \
440455
syscall_table.o \
441456
reent_init.o \
@@ -469,6 +484,7 @@ ESPIDF_NGHTTP_O = $(addprefix $(ESPCOMP)/nghttp/,\
469484

470485
ESPIDF_NVS_FLASH_O = $(addprefix $(ESPCOMP)/nvs_flash/,\
471486
src/nvs_types.o \
487+
src/nvs_ops.o \
472488
src/nvs_page.o \
473489
src/nvs_item_hash_list.o \
474490
src/nvs_pagemanager.o \
@@ -557,75 +573,77 @@ ESPIDF_LWIP_O = $(addprefix $(ESPCOMP)/lwip/,\
557573
)
558574

559575
ESPIDF_MBEDTLS_O = $(addprefix $(ESPCOMP)/mbedtls/,\
560-
library/entropy.o \
561-
library/pkcs12.o \
562-
library/ccm.o \
563-
library/pk.o \
564-
library/sha1.o \
565-
library/x509_csr.o \
566-
library/ssl_cli.o \
567-
library/ecp.o \
568-
library/blowfish.o \
569-
library/x509.o \
570-
library/ecp_curves.o \
571-
library/error.o \
572-
library/ssl_ticket.o \
573-
library/entropy_poll.o \
574-
library/cipher.o \
575-
library/version_features.o \
576-
library/ripemd160.o \
577-
library/rsa.o \
578-
library/md.o \
579-
library/md_wrap.o \
580-
library/sha256.o \
581-
library/dhm.o \
582-
library/ssl_cache.o \
583-
library/pkwrite.o \
584-
library/base64.o \
585-
library/asn1parse.o \
586-
library/ssl_tls.o \
587-
library/hmac_drbg.o \
588-
library/pem.o \
589-
library/version.o \
590-
library/gcm.o \
591-
library/memory_buffer_alloc.o \
592-
library/md2.o \
593-
library/ecdsa.o \
594-
library/ssl_srv.o \
595-
library/x509_crt.o \
596-
library/ecdh.o \
597-
library/asn1write.o \
598-
library/md4.o \
599-
library/debug.o \
600-
library/x509_create.o \
601-
library/ecjpake.o \
602-
library/oid.o \
603-
library/md5.o \
604-
library/ssl_ciphersuites.o \
605-
library/sha512.o \
606-
library/xtea.o \
607-
library/aes.o \
608-
library/cipher_wrap.o \
609-
library/arc4.o \
610-
library/bignum.o \
611-
library/pkparse.o \
612-
library/padlock.o \
613-
library/threading.o \
614-
library/x509_crl.o \
615-
library/pkcs11.o \
616-
library/aesni.o \
617-
library/timing.o \
618-
library/certs.o \
619-
library/pkcs5.o \
620-
library/ssl_cookie.o \
621-
library/camellia.o \
622-
library/havege.o \
623-
library/des.o \
624-
library/x509write_csr.o \
625-
library/platform.o \
626-
library/ctr_drbg.o \
627-
library/x509write_crt.o \
628-
library/pk_wrap.o \
576+
mbedtls/library/entropy.o \
577+
mbedtls/library/pkcs12.o \
578+
mbedtls/library/ccm.o \
579+
mbedtls/library/pk.o \
580+
mbedtls/library/sha1.o \
581+
mbedtls/library/x509_csr.o \
582+
mbedtls/library/ssl_cli.o \
583+
mbedtls/library/ecp.o \
584+
mbedtls/library/blowfish.o \
585+
mbedtls/library/x509.o \
586+
mbedtls/library/ecp_curves.o \
587+
mbedtls/library/error.o \
588+
mbedtls/library/ssl_ticket.o \
589+
mbedtls/library/entropy_poll.o \
590+
mbedtls/library/cipher.o \
591+
mbedtls/library/version_features.o \
592+
mbedtls/library/ripemd160.o \
593+
mbedtls/library/rsa.o \
594+
mbedtls/library/rsa_internal.o \
595+
mbedtls/library/md.o \
596+
mbedtls/library/md_wrap.o \
597+
mbedtls/library/sha256.o \
598+
mbedtls/library/dhm.o \
599+
mbedtls/library/ssl_cache.o \
600+
mbedtls/library/pkwrite.o \
601+
mbedtls/library/base64.o \
602+
mbedtls/library/asn1parse.o \
603+
mbedtls/library/ssl_tls.o \
604+
mbedtls/library/hmac_drbg.o \
605+
mbedtls/library/pem.o \
606+
mbedtls/library/version.o \
607+
mbedtls/library/gcm.o \
608+
mbedtls/library/memory_buffer_alloc.o \
609+
mbedtls/library/md2.o \
610+
mbedtls/library/ecdsa.o \
611+
mbedtls/library/ssl_srv.o \
612+
mbedtls/library/x509_crt.o \
613+
mbedtls/library/ecdh.o \
614+
mbedtls/library/asn1write.o \
615+
mbedtls/library/md4.o \
616+
mbedtls/library/debug.o \
617+
mbedtls/library/x509_create.o \
618+
mbedtls/library/ecjpake.o \
619+
mbedtls/library/oid.o \
620+
mbedtls/library/md5.o \
621+
mbedtls/library/ssl_ciphersuites.o \
622+
mbedtls/library/sha512.o \
623+
mbedtls/library/xtea.o \
624+
mbedtls/library/aes.o \
625+
mbedtls/library/cipher_wrap.o \
626+
mbedtls/library/arc4.o \
627+
mbedtls/library/bignum.o \
628+
mbedtls/library/pkparse.o \
629+
mbedtls/library/padlock.o \
630+
mbedtls/library/threading.o \
631+
mbedtls/library/x509_crl.o \
632+
mbedtls/library/pkcs11.o \
633+
mbedtls/library/aesni.o \
634+
mbedtls/library/timing.o \
635+
mbedtls/library/certs.o \
636+
mbedtls/library/pkcs5.o \
637+
mbedtls/library/ssl_cookie.o \
638+
mbedtls/library/camellia.o \
639+
mbedtls/library/havege.o \
640+
mbedtls/library/des.o \
641+
mbedtls/library/x509write_csr.o \
642+
mbedtls/library/platform.o \
643+
mbedtls/library/platform_util.o \
644+
mbedtls/library/ctr_drbg.o \
645+
mbedtls/library/x509write_crt.o \
646+
mbedtls/library/pk_wrap.o \
629647
port/net_sockets.o \
630648
port/esp_bignum.o \
631649
port/esp_hardware.o \
@@ -634,7 +652,7 @@ ESPIDF_MBEDTLS_O = $(addprefix $(ESPCOMP)/mbedtls/,\
634652
port/esp_sha512.o \
635653
)
636654

637-
$(BUILD)/$(ESPCOMP)/wpa_supplicant/%.o: CFLAGS += -DEMBEDDED_SUPP -D__ets__ -Wno-strict-aliasing
655+
$(BUILD)/$(ESPCOMP)/wpa_supplicant/%.o: CFLAGS += -DESPRESSIF_USE -DEMBEDDED_SUPP -D__ets__ -Wno-strict-aliasing
638656
ESPIDF_WPA_SUPPLICANT_O = $(addprefix $(ESPCOMP)/wpa_supplicant/,\
639657
src/crypto/aes-internal-enc.o \
640658
src/crypto/sha256-internal.o \
@@ -673,6 +691,7 @@ OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_HEAP_O))
673691
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_SOC_O))
674692
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_CXX_O))
675693
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_ETHERNET_O))
694+
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_SMARTCONFIG_ACK_O))
676695
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_APP_TRACE_O))
677696
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_EXPAT_O))
678697
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_FREERTOS_O))
@@ -801,7 +820,7 @@ APP_LD_ARGS += $(ESPCOMP)/newlib/lib/libc.a
801820
APP_LD_ARGS += $(ESPCOMP)/newlib/lib/libm.a
802821
APP_LD_ARGS += $(ESPCOMP)/esp32/libhal.a
803822
APP_LD_ARGS += $(BADGE_LIBS)
804-
APP_LD_ARGS += -L$(ESPCOMP)/esp32/lib -lcore -lnet80211 -lphy -lrtc -lpp -lwpa -lwpa2 -lwps -lsmartconfig -lcoexist
823+
APP_LD_ARGS += -L$(ESPCOMP)/esp32/lib -lcore -lnet80211 -lmesh -lphy -lrtc -lpp -lwpa -lwpa2 -lwps -lsmartconfig -lcoexist
805824
APP_LD_ARGS += $(OBJ)
806825
APP_LD_ARGS += --end-group
807826

@@ -842,16 +861,22 @@ BOOTLOADER_OBJ = $(addprefix $(BUILD)/bootloader/$(ESPCOMP)/,\
842861
bootloader_support/src/bootloader_sha.o \
843862
bootloader_support/src/bootloader_random.o \
844863
bootloader_support/src/bootloader_clock.o \
864+
bootloader_support/src/bootloader_init.o \
865+
bootloader_support/src/bootloader_utility.o \
866+
bootloader_support/src/bootloader_common.o \
845867
bootloader_support/src/secure_boot_signatures.o \
846868
bootloader_support/src/secure_boot.o \
847869
bootloader_support/src/esp_image_format.o \
848870
bootloader_support/src/flash_encrypt.o \
849871
bootloader_support/src/flash_partitions.o \
872+
bootloader_support/src/flash_qio_mode.o \
850873
log/log.o \
851874
spi_flash/spi_flash_rom_patch.o \
875+
soc/esp32/cpu_util.o \
852876
soc/esp32/rtc_clk.o \
853877
soc/esp32/rtc_time.o \
854878
soc/esp32/rtc_init.o \
879+
soc/esp32/rtc_periph.o \
855880
micro-ecc/micro-ecc/uECC.o \
856881
bootloader/subproject/main/bootloader_start.o \
857882
)
@@ -876,6 +901,7 @@ BOOTLOADER_LDFLAGS += -T $(ESPCOMP)/bootloader/subproject/main/esp32.bootloader.
876901
BOOTLOADER_LDFLAGS += -T $(ESPCOMP)/bootloader/subproject/main/esp32.bootloader.rom.ld
877902
BOOTLOADER_LDFLAGS += -T $(ESPCOMP)/esp32/ld/esp32.rom.ld
878903
BOOTLOADER_LDFLAGS += -T $(ESPCOMP)/esp32/ld/esp32.rom.spiram_incompatible_fns.ld
904+
BOOTLOADER_LDFLAGS += -T $(ESPCOMP)/esp32/ld/esp32.peripherals.ld
879905

880906
BOOTLOADER_OBJ_DIRS = $(sort $(dir $(BOOTLOADER_OBJ)))
881907
$(BOOTLOADER_OBJ): | $(BOOTLOADER_OBJ_DIRS)

0 commit comments

Comments
 (0)