-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
esp_bootloader_format: Adds bootloader description structure to read …
- Loading branch information
1 parent
87dd7bb
commit 6983840
Showing
38 changed files
with
419 additions
and
49 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,31 @@ | ||
idf_component_register(SRCS "esp_app_desc.c" | ||
if(NOT BOOTLOADER_BUILD) | ||
set(src "esp_app_desc.c") | ||
else() | ||
set(src "") | ||
endif() | ||
idf_component_register(SRCS ${src} | ||
INCLUDE_DIRS "include") | ||
|
||
# esp_app_desc structure is added as an undefined symbol because otherwise the | ||
# linker will ignore this structure as it has no other files depending on it. | ||
if(NOT BOOTLOADER_BUILD) | ||
# esp_app_desc structure is added as an undefined symbol because otherwise the | ||
# linker will ignore this structure as it has no other files depending on it. | ||
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u esp_app_desc") | ||
endif() | ||
|
||
if(CONFIG_APP_PROJECT_VER_FROM_CONFIG) | ||
# Ignore current PROJECT_VER (which was set in __project_get_revision()). | ||
# Gets the version from the CONFIG_APP_PROJECT_VER. | ||
idf_build_set_property(PROJECT_VER "${CONFIG_APP_PROJECT_VER}") | ||
endif() | ||
if(CONFIG_APP_PROJECT_VER_FROM_CONFIG) | ||
# Ignore current PROJECT_VER (which was set in __project_get_revision()). | ||
# Gets the version from the CONFIG_APP_PROJECT_VER. | ||
idf_build_set_property(PROJECT_VER "${CONFIG_APP_PROJECT_VER}") | ||
endif() | ||
|
||
# cut PROJECT_VER and PROJECT_NAME to required 32 characters. | ||
idf_build_get_property(project_ver PROJECT_VER) | ||
idf_build_get_property(project_name PROJECT_NAME) | ||
string(SUBSTRING "${project_ver}" 0 31 PROJECT_VER_CUT) | ||
string(SUBSTRING "${project_name}" 0 31 PROJECT_NAME_CUT) | ||
message(STATUS "App \"${PROJECT_NAME_CUT}\" version: ${PROJECT_VER_CUT}") | ||
# cut PROJECT_VER and PROJECT_NAME to required 32 characters. | ||
idf_build_get_property(project_ver PROJECT_VER) | ||
idf_build_get_property(project_name PROJECT_NAME) | ||
string(SUBSTRING "${project_ver}" 0 31 PROJECT_VER_CUT) | ||
string(SUBSTRING "${project_name}" 0 31 PROJECT_NAME_CUT) | ||
message(STATUS "App \"${PROJECT_NAME_CUT}\" version: ${PROJECT_VER_CUT}") | ||
|
||
set_source_files_properties( | ||
SOURCE "esp_app_desc.c" | ||
PROPERTIES COMPILE_DEFINITIONS | ||
"PROJECT_VER=\"${PROJECT_VER_CUT}\"; PROJECT_NAME=\"${PROJECT_NAME_CUT}\"") | ||
set_source_files_properties( | ||
SOURCE "esp_app_desc.c" | ||
PROPERTIES COMPILE_DEFINITIONS | ||
"PROJECT_VER=\"${PROJECT_VER_CUT}\"; PROJECT_NAME=\"${PROJECT_NAME_CUT}\"") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Documentation: .gitlab/ci/README.md#manifest-file-to-control-the-buildtest-apps | ||
|
||
components/esp_bootloader_format/test_apps: | ||
disable: | ||
- if: IDF_TARGET != "esp32" | ||
reason: It is enough to test it only for one target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
idf_component_register(SRCS "esp_bootloader_desc.c" | ||
INCLUDE_DIRS "include") | ||
|
||
if(BOOTLOADER_BUILD) | ||
# esp_bootloader_desc structure is added as an undefined symbol because otherwise the | ||
# linker will ignore this structure as it has no other files depending on it. | ||
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u esp_bootloader_desc") | ||
|
||
idf_build_get_property(project_name PROJECT_NAME) | ||
message(STATUS "Bootloader project name: \"${project_name}\" version: ${CONFIG_BOOTLOADER_PROJECT_VER}") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
menu "Bootloader manager" | ||
|
||
config BOOTLOADER_COMPILE_TIME_DATE | ||
bool "Use time/date stamp for bootloader" | ||
default y | ||
depends on !APP_REPRODUCIBLE_BUILD | ||
help | ||
If set, then the bootloader will be built with the current time/date stamp. | ||
It is stored in the bootloader description | ||
structure. If not set, time/date stamp will be excluded from bootloader image. | ||
This can be useful for getting the | ||
same binary image files made from the same source, but at different times. | ||
|
||
config BOOTLOADER_PROJECT_VER | ||
int "Project version" | ||
default 1 | ||
range 0 4294967295 | ||
help | ||
Project version. It is placed in "version" field of the esp_bootloader_desc structure. | ||
The type of this field is "uint32_t". | ||
endmenu # "Bootloader manager" |
Oops, something went wrong.