Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for vendor SDK 2.2.0/3.0.0 #344

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ TOOLCHAIN = $(TOP)/xtensa-lx106-elf

# Vendor SDK version to install, see VENDOR_SDK_ZIP_* vars below
# for supported versions.
VENDOR_SDK = 2.1.0-18-g61248df
VENDOR_SDK = 3.0.0

.PHONY: crosstool-NG toolchain libhal libcirom sdk

Expand All @@ -23,6 +23,10 @@ UNZIP = unzip -q -o
VENDOR_SDK_ZIP = $(VENDOR_SDK_ZIP_$(VENDOR_SDK))
VENDOR_SDK_DIR = $(VENDOR_SDK_DIR_$(VENDOR_SDK))

VENDOR_SDK_ZIP_3.0.0 = ESP8266_NONOS_SDK-3.0.zip
VENDOR_SDK_DIR_3.0.0 = ESP8266_NONOS_SDK-3.0
VENDOR_SDK_ZIP_2.2.0 = ESP8266_NONOS_SDK-2.2.0.zip
VENDOR_SDK_DIR_2.2.0 = ESP8266_NONOS_SDK-2.2.0
VENDOR_SDK_DIR_2.1.0-18-g61248df = ESP8266_NONOS_SDK-2.1.0-18-g61248df
VENDOR_SDK_ZIP_2.1.0 = ESP8266_NONOS_SDK-2.1.0.zip
VENDOR_SDK_DIR_2.1.0 = ESP8266_NONOS_SDK-2.1.0
Expand Down Expand Up @@ -180,6 +184,14 @@ $(VENDOR_SDK_DIR)/.dir: $(VENDOR_SDK_ZIP)
-mv License $(VENDOR_SDK_DIR)
touch $@

$(VENDOR_SDK_DIR_3.0.0)/.dir: $(VENDOR_SDK_ZIP_3.0.0)
$(UNZIP) $^
touch $@

$(VENDOR_SDK_DIR_2.2.0)/.dir: $(VENDOR_SDK_ZIP_2.2.0)
$(UNZIP) $^
touch $@

$(VENDOR_SDK_DIR_2.1.0-18-g61248df)/.dir:
echo $(VENDOR_SDK_DIR_2.1.0-18-g61248df)
git clone https://github.com/espressif/ESP8266_NONOS_SDK $(VENDOR_SDK_DIR_2.1.0-18-g61248df)
Expand All @@ -204,6 +216,20 @@ $(VENDOR_SDK_DIR_1.5.4)/.dir: $(VENDOR_SDK_ZIP_1.5.4)

sdk_patch: $(VENDOR_SDK_DIR)/.dir .sdk_patch_$(VENDOR_SDK)

.sdk_patch_3.0.0: user_rf_cal_sector_set.o
echo -e "#undef ESP_SDK_VERSION\n#define ESP_SDK_VERSION 030000" >>$(VENDOR_SDK_DIR)/include/esp_sdk_ver.h
$(PATCH) -d $(VENDOR_SDK_DIR) -p1 < c_types-c99_sdk_2.patch
cd $(VENDOR_SDK_DIR)/lib; mkdir -p tmp; cd tmp; $(TOOLCHAIN)/bin/xtensa-lx106-elf-ar x ../libcrypto.a; cd ..; $(TOOLCHAIN)/bin/xtensa-lx106-elf-ar rs libwpa.a tmp/*.o
$(TOOLCHAIN)/bin/xtensa-lx106-elf-ar r $(VENDOR_SDK_DIR)/lib/libmain.a user_rf_cal_sector_set.o
@touch $@

.sdk_patch_2.2.0: user_rf_cal_sector_set.o
echo -e "#undef ESP_SDK_VERSION\n#define ESP_SDK_VERSION 020200" >>$(VENDOR_SDK_DIR)/include/esp_sdk_ver.h
$(PATCH) -d $(VENDOR_SDK_DIR) -p1 < c_types-c99_sdk_2.patch
cd $(VENDOR_SDK_DIR)/lib; mkdir -p tmp; cd tmp; $(TOOLCHAIN)/bin/xtensa-lx106-elf-ar x ../libcrypto.a; cd ..; $(TOOLCHAIN)/bin/xtensa-lx106-elf-ar rs libwpa.a tmp/*.o
$(TOOLCHAIN)/bin/xtensa-lx106-elf-ar r $(VENDOR_SDK_DIR)/lib/libmain.a user_rf_cal_sector_set.o
@touch $@

.sdk_patch_2.1.0-18-g61248df .sdk_patch_2.1.0: user_rf_cal_sector_set.o
echo -e "#undef ESP_SDK_VERSION\n#define ESP_SDK_VERSION 020100" >>$(VENDOR_SDK_DIR)/include/esp_sdk_ver.h
$(PATCH) -d $(VENDOR_SDK_DIR) -p1 < c_types-c99_sdk_2.patch
Expand Down Expand Up @@ -365,6 +391,10 @@ ifeq ($(STANDALONE),y)
endif


ESP8266_NONOS_SDK-3.0.zip:
wget --content-disposition "https://github.com/espressif/ESP8266_NONOS_SDK/archive/v3.0.zip"
ESP8266_NONOS_SDK-2.2.0.zip:
wget --content-disposition "https://github.com/espressif/ESP8266_NONOS_SDK/archive/v2.2.0.zip"
ESP8266_NONOS_SDK-2.1.0.zip:
wget --content-disposition "https://github.com/espressif/ESP8266_NONOS_SDK/archive/v2.1.0.zip"
# The only change wrt to ESP8266_NONOS_SDK_V2.0.0_16_07_19.zip is licensing blurb in source/
Expand Down