mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
phy init data: Read PHY init data partition offset from menuconfig
This commit is contained in:
parent
4db29f74a0
commit
6d4ab76db2
@ -3,34 +3,21 @@ ifdef CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION
|
|||||||
PHY_INIT_DATA_OBJ = $(BUILD_DIR_BASE)/phy_init_data.o
|
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_BIN = $(BUILD_DIR_BASE)/phy_init_data.bin
|
||||||
|
|
||||||
PARTITION_TABLE_COMPONENT_PATH := $(COMPONENT_PATH)/../partition_table
|
|
||||||
ESP32_COMPONENT_PATH := $(COMPONENT_PATH)
|
|
||||||
|
|
||||||
GEN_ESP32PART := $(PYTHON) $(PARTITION_TABLE_COMPONENT_PATH)/gen_esp32part.py -q
|
|
||||||
|
|
||||||
# Path to partition CSV file is relative to project path for custom
|
|
||||||
# partition CSV files, but relative to component dir otherwise.
|
|
||||||
PARTITION_TABLE_ROOT := $(call dequote,$(if $(CONFIG_PARTITION_TABLE_CUSTOM),$(PROJECT_PATH),$(PARTITION_TABLE_COMPONENT_PATH)))
|
|
||||||
PARTITION_TABLE_CSV_PATH := $(call dequote,$(abspath $(PARTITION_TABLE_ROOT)/$(subst $(quote),,$(CONFIG_PARTITION_TABLE_FILENAME))))
|
|
||||||
PARTITION_TABLE_BIN := $(BUILD_DIR_BASE)/$(notdir $(PARTITION_TABLE_CSV_PATH:.csv=.bin))
|
|
||||||
|
|
||||||
# Parse partition table and get offset of PHY init data partition
|
|
||||||
PHY_INIT_GET_ADDR_CMD := $(GEN_ESP32PART) $(PARTITION_TABLE_CSV_PATH) | $(GEN_ESP32PART) - | sed -n -e "s/[^,]*,data,phy,\\([^,]*\\),.*/\\1/p"
|
|
||||||
PHY_INIT_DATA_ADDR = $(shell $(PHY_INIT_GET_ADDR_CMD))
|
|
||||||
|
|
||||||
# Command to flash PHY init data partition
|
# Command to flash PHY init data partition
|
||||||
PHY_INIT_DATA_FLASH_CMD = $(ESPTOOLPY_SERIAL) write_flash $(PHY_INIT_DATA_ADDR) $(PHY_INIT_DATA_BIN)
|
PHY_INIT_DATA_FLASH_CMD = $(ESPTOOLPY_SERIAL) write_flash $(CONFIG_PHY_DATA_OFFSET) $(PHY_INIT_DATA_BIN)
|
||||||
ESPTOOL_ALL_FLASH_ARGS += $(PHY_INIT_DATA_ADDR) $(PHY_INIT_DATA_BIN)
|
ESPTOOL_ALL_FLASH_ARGS += $(CONFIG_PHY_DATA_OFFSET) $(PHY_INIT_DATA_BIN)
|
||||||
|
|
||||||
|
ESP32_COMPONENT_PATH := $(COMPONENT_PATH)
|
||||||
|
|
||||||
$(PHY_INIT_DATA_OBJ): $(ESP32_COMPONENT_PATH)/phy_init_data.h $(BUILD_DIR_BASE)/include/sdkconfig.h
|
$(PHY_INIT_DATA_OBJ): $(ESP32_COMPONENT_PATH)/phy_init_data.h $(BUILD_DIR_BASE)/include/sdkconfig.h
|
||||||
$(summary) CC $(notdir $@)
|
$(summary) CC $(notdir $@)
|
||||||
printf "#include \"phy_init_data.h\"\n" | $(CC) -I $(BUILD_DIR_BASE)/include -I $(ESP32_COMPONENT_PATH) -I $(ESP32_COMPONENT_PATH)/include -c -o $@ -xc -
|
printf "#include \"phy_init_data.h\"\n" | $(CC) -I $(BUILD_DIR_BASE)/include -I $(ESP32_COMPONENT_PATH) -I $(ESP32_COMPONENT_PATH)/include -c -o $@ -xc -
|
||||||
|
|
||||||
$(PHY_INIT_DATA_BIN): $(PHY_INIT_DATA_OBJ)
|
$(PHY_INIT_DATA_BIN): $(PHY_INIT_DATA_OBJ)
|
||||||
$(summary) BIN $(notdir $@)
|
$(summary) BIN $(notdir $@)
|
||||||
$(OBJCOPY) -O binary $< $@
|
$(OBJCOPY) -O binary $< $@
|
||||||
|
|
||||||
phy_init_data: $(PHY_INIT_DATA_BIN)
|
phy_init_data: $(PHY_INIT_DATA_BIN)
|
||||||
|
|
||||||
phy_init_data-flash: $(BUILD_DIR_BASE)/phy_init_data.bin
|
phy_init_data-flash: $(BUILD_DIR_BASE)/phy_init_data.bin
|
||||||
@echo "Flashing PHY init data..."
|
@echo "Flashing PHY init data..."
|
||||||
@ -39,4 +26,7 @@ phy_init_data-flash: $(BUILD_DIR_BASE)/phy_init_data.bin
|
|||||||
phy_init_data-clean:
|
phy_init_data-clean:
|
||||||
rm -f $(PHY_INIT_DATA_BIN) $(PHY_INIT_DATA_OBJ)
|
rm -f $(PHY_INIT_DATA_BIN) $(PHY_INIT_DATA_OBJ)
|
||||||
|
|
||||||
|
all: phy_init_data
|
||||||
|
flash: phy_init_data
|
||||||
|
|
||||||
endif # CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION
|
endif # CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION
|
||||||
|
@ -1,49 +1,63 @@
|
|||||||
menu "Partition Table"
|
menu "Partition Table"
|
||||||
|
|
||||||
choice
|
choice
|
||||||
prompt "Partition Table"
|
prompt "Partition Table"
|
||||||
default PARTITION_TABLE_SINGLE_APP
|
default PARTITION_TABLE_SINGLE_APP
|
||||||
help
|
help
|
||||||
The partition table to flash to the ESP32. The partition table
|
The partition table to flash to the ESP32. The partition table
|
||||||
determines where apps, data and other resources are expected to
|
determines where apps, data and other resources are expected to
|
||||||
be found.
|
be found.
|
||||||
|
|
||||||
The predefined partition table CSV descriptions can be found
|
The predefined partition table CSV descriptions can be found
|
||||||
in the components/partition_table directory. Otherwise it's
|
in the components/partition_table directory. Otherwise it's
|
||||||
possible to create a new custom partition CSV for your application.
|
possible to create a new custom partition CSV for your application.
|
||||||
|
|
||||||
config PARTITION_TABLE_SINGLE_APP
|
config PARTITION_TABLE_SINGLE_APP
|
||||||
bool "Single factory app, no OTA"
|
bool "Single factory app, no OTA"
|
||||||
config PARTITION_TABLE_TWO_OTA
|
config PARTITION_TABLE_TWO_OTA
|
||||||
bool "Factory app, two OTA definitions"
|
bool "Factory app, two OTA definitions"
|
||||||
config PARTITION_TABLE_CUSTOM
|
config PARTITION_TABLE_CUSTOM
|
||||||
bool "Custom partition table CSV"
|
bool "Custom partition table CSV"
|
||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
config PARTITION_TABLE_CUSTOM_FILENAME
|
config PARTITION_TABLE_CUSTOM_FILENAME
|
||||||
string "Custom partition CSV file" if PARTITION_TABLE_CUSTOM
|
string "Custom partition CSV file" if PARTITION_TABLE_CUSTOM
|
||||||
default partitions.csv
|
default partitions.csv
|
||||||
help
|
help
|
||||||
Name of the custom partition CSV filename. This path is evaluated
|
Name of the custom partition CSV filename. This path is evaluated
|
||||||
relative to the project root directory.
|
relative to the project root directory.
|
||||||
|
|
||||||
config PARTITION_TABLE_CUSTOM_APP_BIN_OFFSET
|
config PARTITION_TABLE_CUSTOM_APP_BIN_OFFSET
|
||||||
hex "App offset in flash" if PARTITION_TABLE_CUSTOM
|
hex "Factory app partition offset" if PARTITION_TABLE_CUSTOM
|
||||||
default 0x10000
|
default 0x10000
|
||||||
help
|
help
|
||||||
If using a custom partition table, specify the offset in the flash
|
If using a custom partition table, specify the offset in the flash
|
||||||
where 'make flash' should write the built app.
|
where 'make flash' should write the built app.
|
||||||
|
|
||||||
|
config PARTITION_TABLE_CUSTOM_PHY_DATA_OFFSET
|
||||||
|
hex "PHY data partition offset" if PARTITION_TABLE_CUSTOM
|
||||||
|
depends on ESP32_PHY_INIT_DATA_IN_PARTITION
|
||||||
|
default 0xf000
|
||||||
|
help
|
||||||
|
If using a custom partition table, specify the offset in the flash
|
||||||
|
where 'make flash' should write the initial PHY data file.
|
||||||
|
|
||||||
|
|
||||||
config PARTITION_TABLE_FILENAME
|
config PARTITION_TABLE_FILENAME
|
||||||
string
|
string
|
||||||
default partitions_singleapp.csv if PARTITION_TABLE_SINGLE_APP
|
default partitions_singleapp.csv if PARTITION_TABLE_SINGLE_APP
|
||||||
default partitions_two_ota.csv if PARTITION_TABLE_TWO_OTA
|
default partitions_two_ota.csv if PARTITION_TABLE_TWO_OTA
|
||||||
default PARTITION_TABLE_CUSTOM_FILENAME if PARTITION_TABLE_CUSTOM
|
default PARTITION_TABLE_CUSTOM_FILENAME if PARTITION_TABLE_CUSTOM
|
||||||
|
|
||||||
config APP_OFFSET
|
config APP_OFFSET
|
||||||
hex
|
hex
|
||||||
default PARTITION_TABLE_CUSTOM_APP_BIN_OFFSET if PARTITION_TABLE_CUSTOM
|
default PARTITION_TABLE_CUSTOM_APP_BIN_OFFSET if PARTITION_TABLE_CUSTOM
|
||||||
default 0x10000 # this is the factory app offset used by the default tables
|
default 0x10000 # this is the factory app offset used by the default tables
|
||||||
|
|
||||||
|
config PHY_DATA_OFFSET
|
||||||
|
hex
|
||||||
|
default PARTITION_TABLE_CUSTOM_PHY_DATA_OFFSET if PARTITION_TABLE_CUSTOM
|
||||||
|
default 0xf000 # this is the factory app offset used by the default tables
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
# Name, Type, SubType, Offset, Size
|
# Name, Type, SubType, Offset, Size
|
||||||
|
# Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild
|
||||||
nvs, data, nvs, 0x9000, 0x6000
|
nvs, data, nvs, 0x9000, 0x6000
|
||||||
phy_init, data, phy, 0xf000, 0x1000
|
phy_init, data, phy, 0xf000, 0x1000
|
||||||
factory, app, factory, 0x10000, 1M
|
factory, app, factory, 0x10000, 1M
|
||||||
|
|
@ -1,4 +1,5 @@
|
|||||||
# Name, Type, SubType, Offset, Size
|
# Name, Type, SubType, Offset, Size
|
||||||
|
# Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild
|
||||||
nvs, data, nvs, 0x9000, 0x4000
|
nvs, data, nvs, 0x9000, 0x4000
|
||||||
otadata, data, ota, 0xd000, 0x2000
|
otadata, data, ota, 0xd000, 0x2000
|
||||||
phy_init, data, phy, 0xf000, 0x1000
|
phy_init, data, phy, 0xf000, 0x1000
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user