2019-06-11 23:52:23 -04:00
|
|
|
ifdef CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION
|
|
|
|
|
2020-04-08 08:16:08 -04:00
|
|
|
ESP_WIFI_COMPONENT_PATH := $(COMPONENT_PATH)
|
|
|
|
|
|
|
|
ifdef CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN
|
2021-05-30 04:32:06 -04:00
|
|
|
PHY_INIT_DATA_BIN = $(ESP_WIFI_COMPONENT_PATH)/$(IDF_TARGET)/phy_multiple_init_data.bin
|
2020-04-08 08:16:08 -04:00
|
|
|
else
|
2019-06-11 23:52:23 -04:00
|
|
|
PHY_INIT_DATA_OBJ = $(BUILD_DIR_BASE)/phy_init_data.o
|
|
|
|
PHY_INIT_DATA_BIN = $(BUILD_DIR_BASE)/phy_init_data.bin
|
|
|
|
|
|
|
|
$(PHY_INIT_DATA_OBJ): $(ESP_WIFI_COMPONENT_PATH)/$(IDF_TARGET)/include/phy_init_data.h $(BUILD_DIR_BASE)/include/sdkconfig.h
|
|
|
|
$(summary) CC $(notdir $@)
|
|
|
|
printf "#include \"phy_init_data.h\"\n" | $(CC) -I $(BUILD_DIR_BASE)/include -I $(ESP_WIFI_COMPONENT_PATH)/../esp_common/include -I $(ESP_WIFI_COMPONENT_PATH)/include -I $(ESP_WIFI_COMPONENT_PATH)/$(IDF_TARGET)/include -c -o $@ -xc -
|
|
|
|
|
|
|
|
$(PHY_INIT_DATA_BIN): $(PHY_INIT_DATA_OBJ)
|
|
|
|
$(summary) BIN $(notdir $@)
|
|
|
|
$(OBJCOPY) -O binary $< $@
|
2020-04-08 08:16:08 -04:00
|
|
|
endif
|
|
|
|
|
|
|
|
# Command to flash PHY init data partition
|
|
|
|
PHY_INIT_DATA_FLASH_CMD = $(ESPTOOLPY_SERIAL) write_flash $(PHY_DATA_OFFSET) $(PHY_INIT_DATA_BIN)
|
|
|
|
ESPTOOL_ALL_FLASH_ARGS += $(PHY_DATA_OFFSET) $(PHY_INIT_DATA_BIN)
|
2019-06-11 23:52:23 -04:00
|
|
|
|
|
|
|
phy_init_data: $(PHY_INIT_DATA_BIN)
|
|
|
|
|
2020-04-08 08:16:08 -04:00
|
|
|
phy_init_data-flash: $(PHY_INIT_DATA_BIN)
|
2019-06-11 23:52:23 -04:00
|
|
|
@echo "Flashing PHY init data..."
|
|
|
|
$(PHY_INIT_DATA_FLASH_CMD)
|
|
|
|
|
2020-04-08 08:16:08 -04:00
|
|
|
ifndef CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN
|
2019-06-11 23:52:23 -04:00
|
|
|
phy_init_data-clean:
|
|
|
|
rm -f $(PHY_INIT_DATA_BIN) $(PHY_INIT_DATA_OBJ)
|
|
|
|
|
2020-04-08 08:16:08 -04:00
|
|
|
clean: phy_init_data-clean
|
|
|
|
endif
|
|
|
|
|
2019-06-11 23:52:23 -04:00
|
|
|
all: phy_init_data
|
|
|
|
flash: phy_init_data
|
|
|
|
|
|
|
|
endif # CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION
|