From 16f0bf4fdca5da38529a8b6c3143e0b6df1fdcd1 Mon Sep 17 00:00:00 2001 From: Schorcht Date: Sat, 10 Nov 2018 14:14:49 +0100 Subject: [PATCH] cpu/esp32: fixes compile problems --- boards/common/esp32/include/board_common.h | 4 ++++ cpu/esp32/Makefile.dep | 19 ++++++++++++++----- cpu/esp32/Makefile.include | 2 ++ .../wpa_supplicant/src/crypto/Makefile | 5 +---- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/boards/common/esp32/include/board_common.h b/boards/common/esp32/include/board_common.h index 3db6072fd1..fde0d30b25 100644 --- a/boards/common/esp32/include/board_common.h +++ b/boards/common/esp32/include/board_common.h @@ -23,6 +23,9 @@ #ifndef BOARD_COMMON_H #define BOARD_COMMON_H +/* not required when compiling ESP32 vendor code parts */ +#ifndef ESP32_IDF_CODE + #include #include "cpu.h" @@ -161,5 +164,6 @@ void print_board_config (void); } /* end extern "C" */ #endif +#endif /* ESP32_IDF_CODE */ #endif /* BOARD_COMMON_H */ /** @} */ diff --git a/cpu/esp32/Makefile.dep b/cpu/esp32/Makefile.dep index 162dfa6033..fb9f6690a6 100644 --- a/cpu/esp32/Makefile.dep +++ b/cpu/esp32/Makefile.dep @@ -37,6 +37,16 @@ ifneq (,$(filter esp_wifi_any,$(USEMODULE))) DISABLE_MODULE += hashes endif +ifneq (,$(filter esp_idf_nvs_flash,$(USEMODULE))) + # add additional modules required by esp_idf_nvs_flash + USEMODULE += pthread +endif + +ifneq (,$(filter esp_idf_nvs_flash,$(USEMODULE))) + # add additional modules required by riot_riot_freertos + USEMODULE += xtimer +endif + ifneq (,$(filter esp_i2c_hw,$(USEMODULE))) USEMODULE += xtimer else @@ -52,12 +62,11 @@ endif # each device has SPI flash memory, but must be explicitly enabled ifneq (,$(filter esp_spiffs,$(USEMODULE))) - USEMODULE += esp_idf_spi_flash USEMODULE += spiffs - USEMODULE += vfs - export SPIFFS_STD_OPTION = -std=c99 - INCLUDES += -I$(RIOTBASE)/sys/include - INCLUDES += -I$(RIOTBASE)/sys/posix/include +endif + +ifneq (,$(filter mtd,$(USEMODULE))) + USEMODULE += esp_idf_spi_flash endif ifneq (,$(filter ndn-riot,$(USEPKG))) diff --git a/cpu/esp32/Makefile.include b/cpu/esp32/Makefile.include index 442a8d334f..12ff0b1afa 100644 --- a/cpu/esp32/Makefile.include +++ b/cpu/esp32/Makefile.include @@ -126,7 +126,9 @@ ifneq (,$(filter esp_wifi_any,$(USEMODULE))) LINKFLAGS += $(BINDIR)/esp_idf_esp32.a LINKFLAGS += $(BINDIR)/esp_idf_nvs_flash.a LINKFLAGS += $(BINDIR)/esp_idf_spi_flash.a + LINKFLAGS += $(BINDIR)/pthread.a LINKFLAGS += $(BINDIR)/riot_freertos.a + LINKFLAGS += $(BINDIR)/xtimer.a LINKFLAGS += -lcore -lrtc -lnet80211 -lpp -lsmartconfig -lcoexist LINKFLAGS += -lwps -lwpa -lwpa2 -lespnow -lmesh -lphy -lstdc++ endif diff --git a/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/crypto/Makefile b/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/crypto/Makefile index 90e894d791..f5043bb9a1 100644 --- a/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/crypto/Makefile +++ b/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/crypto/Makefile @@ -7,14 +7,11 @@ include $(RIOTBASE)/Makefile.base INCLUDES = -I$(RIOTCPU)/$(CPU)/vendor/esp-idf/wpa_supplicant/port/include INCLUDES += -I$(ESP32_SDK_DIR)/components/wpa_supplicant/include INCLUDES += -I$(ESP32_SDK_DIR)/components/wpa_supplicant/port/include -CFLAGS += -D__ets__ -DESPRESSIF_USE +CFLAGS += -D__ets__ -DESPRESSIF_USE -DESP32_IDF_CODE=1 include $(RIOTCPU)/$(CPU)/Makefile.include INCLUDES += -I$(RIOTBASE)/core/include -INCLUDES += -I$(RIOTBASE)/drivers/include -INCLUDES += -I$(RIOTBASE)/sys/include -INCLUDES += -I$(RIOTBASE)/sys/posix/include INCLUDES += -I$(RIOTCPU)/$(CPU)/vendor/esp-idf/include/log INCLUDES += -I$(RIOTCPU)/$(CPU)/include INCLUDES += -I$(RIOTBOARD)/$(BOARD)/include