ifdef CONFIG_ESP8266_LEGACY BOOTLOADER_FIRMWARE_DIR := $(abspath $(COMPONENT_PATH))/firmware ESPTOOLPY_FLASHSIZE ?= $(CONFIG_ESPTOOLPY_FLASHSIZE) ifeq ($(ESPTOOLPY_FLASHSIZE), "2MB") ESP_INIT_DATA_DEFAULT_BIN_OFFSET := 0x1FC000 endif ifeq ($(ESPTOOLPY_FLASHSIZE), "4MB") ESP_INIT_DATA_DEFAULT_BIN_OFFSET := 0x3FC000 endif ifeq ($(ESPTOOLPY_FLASHSIZE), "8MB") ESP_INIT_DATA_DEFAULT_BIN_OFFSET := 0x7FC000 endif ifeq ($(ESPTOOLPY_FLASHSIZE), "16MB") ESP_INIT_DATA_DEFAULT_BIN_OFFSET := 0xFFC000 endif ESP_INIT_DATA_DEFAULT_BIN := $(BOOTLOADER_FIRMWARE_DIR)/esp_init_data_default.bin ESPTOOL_ALL_FLASH_ARGS += $(ESP_INIT_DATA_DEFAULT_BIN_OFFSET) $(ESP_INIT_DATA_DEFAULT_BIN) else ifdef CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION PHY_INIT_DATA_OBJ = $(BUILD_DIR_BASE)/phy_init_data.o PHY_INIT_DATA_BIN = $(BUILD_DIR_BASE)/phy_init_data.bin # Command to flash PHY init data partition PHY_INIT_DATA_FLASH_CMD = $(ESPTOOLPY_SERIAL) write_flash $(CONFIG_PHY_DATA_OFFSET) $(PHY_INIT_DATA_BIN) ESPTOOL_ALL_FLASH_ARGS += $(CONFIG_PHY_DATA_OFFSET) $(PHY_INIT_DATA_BIN) ESP8266_COMPONENT_PATH := $(COMPONENT_PATH) $(PHY_INIT_DATA_OBJ): $(ESP8266_COMPONENT_PATH)/source/phy_init_data.h $(BUILD_DIR_BASE)/include/sdkconfig.h $(summary) CC $(notdir $@) printf "#include \"source/phy_init_data.h\"\n" | $(CC) -I $(BUILD_DIR_BASE)/include -I $(ESP8266_COMPONENT_PATH) -I $(ESP8266_COMPONENT_PATH)/include -c -o $@ -xc - $(PHY_INIT_DATA_BIN): $(PHY_INIT_DATA_OBJ) $(summary) BIN $(notdir $@) $(OBJCOPY) -O binary $< $@ phy_init_data: $(PHY_INIT_DATA_BIN) phy_init_data-flash: $(BUILD_DIR_BASE)/phy_init_data.bin @echo "Flashing PHY init data..." $(PHY_INIT_DATA_FLASH_CMD) phy_init_data-clean: rm -f $(PHY_INIT_DATA_BIN) $(PHY_INIT_DATA_OBJ) all: phy_init_data flash: phy_init_data endif # CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION endif # global CFLAGS for ESP8266 CFLAGS += -DMEMLEAK_DEBUG -DICACHE_FLASH # void compiler error, we should remove these later CFLAGS += -Wno-error=char-subscripts -Wno-error=unknown-pragmas -Wno-error=implicit-function-declaration \ -Wno-error=pointer-sign -Wno-error=switch -Wno-error=maybe-uninitialized -Wno-error=format= \ -Wno-error=unused-value -Wno-error=address -Wno-error=return-type -Wno-error=format-extra-args \ -Wno-error=format-zero-length -Wno-error=unused-label -Wno-error=sizeof-pointer-memaccess