Skip to content

Commit

Permalink
Merge branch 'bugfix/revision_format_v5.0' into 'release/v5.0'
Browse files Browse the repository at this point in the history
soc: upgrade version printing to vX.Y (v5.0)

See merge request espressif/esp-idf!21011
  • Loading branch information
ginkgm committed Nov 11, 2022
2 parents 3f2f35b + f8d4bc8 commit 7f4bcc3
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 7 deletions.
5 changes: 4 additions & 1 deletion components/bootloader_support/src/bootloader_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ esp_err_t bootloader_read_bootloader_header(void)

esp_err_t bootloader_check_bootloader_validity(void)
{
ESP_LOGI(TAG, "chip revision: V%03d", efuse_hal_chip_revision());
unsigned int revision = efuse_hal_chip_revision();
unsigned int major = revision / 100;
unsigned int minor = revision % 100;
ESP_LOGI(TAG, "chip revision: v%d.%d", major, minor);
/* compare with the one set in bootloader image header */
if (bootloader_common_check_chip_validity(&bootloader_image_hdr, ESP_IMAGE_BOOTLOADER) != ESP_OK) {
return ESP_FAIL;
Expand Down
4 changes: 3 additions & 1 deletion examples/build_system/cmake/idf_as_lib/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ void app_main(void)
(chip_info.features & CHIP_FEATURE_BT) ? "/BT" : "",
(chip_info.features & CHIP_FEATURE_BLE) ? "/BLE" : "");

printf("silicon revision %d, ", chip_info.revision);
unsigned major_rev = chip_info.revision / 100;
unsigned minor_rev = chip_info.revision % 100;
printf("silicon revision v%d.%d, ", major_rev, minor_rev);
if(esp_flash_get_size(NULL, &flash_size) != ESP_OK) {
printf("Get flash size failed");
return;
Expand Down
4 changes: 3 additions & 1 deletion examples/get-started/hello_world/main/hello_world_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ void app_main(void)
(chip_info.features & CHIP_FEATURE_BT) ? "/BT" : "",
(chip_info.features & CHIP_FEATURE_BLE) ? "/BLE" : "");

printf("silicon revision %d, ", chip_info.revision);
unsigned major_rev = chip_info.revision / 100;
unsigned minor_rev = chip_info.revision % 100;
printf("silicon revision v%d.%d, ", major_rev, minor_rev);
if(esp_flash_get_size(NULL, &flash_size) != ESP_OK) {
printf("Get flash size failed");
return;
Expand Down
4 changes: 3 additions & 1 deletion examples/security/flash_encryption/main/flash_encrypt_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ static void example_print_chip_info(void)
(chip_info.features & CHIP_FEATURE_BT) ? "/BT" : "",
(chip_info.features & CHIP_FEATURE_BLE) ? "/BLE" : "");

printf("silicon revision %d, ", chip_info.revision);
unsigned major_rev = chip_info.revision / 100;
unsigned minor_rev = chip_info.revision % 100;
printf("silicon revision v%d.%d, ", major_rev, minor_rev);
if(esp_flash_get_size(NULL, &flash_size) != ESP_OK) {
printf("Get flash size failed");
return;
Expand Down
4 changes: 3 additions & 1 deletion tools/test_apps/security/secure_boot/main/secure_boot_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ static void example_print_chip_info(void)
esp_chip_info(&chip_info);
printf("This is %s chip with %d CPU cores\n", CONFIG_IDF_TARGET, chip_info.cores);

printf("silicon revision %d, ", chip_info.revision);
unsigned major_rev = chip_info.revision / 100;
unsigned minor_rev = chip_info.revision % 100;
printf("silicon revision v%d.%d, ", major_rev, minor_rev);
if(esp_flash_get_size(NULL, &flash_size) != ESP_OK) {
printf("Get flash size failed");
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ static void example_print_chip_info(void)
(chip_info.features & CHIP_FEATURE_BT) ? "/BT" : "",
(chip_info.features & CHIP_FEATURE_BLE) ? "/BLE" : "");

printf("silicon revision %d, ", chip_info.revision);
unsigned major_rev = chip_info.revision / 100;
unsigned minor_rev = chip_info.revision % 100;
printf("silicon revision v%d.%d, ", major_rev, minor_rev);
if(esp_flash_get_size(NULL, &flash_size) != ESP_OK) {
printf("Get flash size failed");
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ void app_main(void)
(chip_info.features & CHIP_FEATURE_BT) ? "/BT" : "",
(chip_info.features & CHIP_FEATURE_BLE) ? "/BLE" : "");

printf("silicon revision %d, ", chip_info.revision);
unsigned major_rev = chip_info.revision / 100;
unsigned minor_rev = chip_info.revision % 100;
printf("silicon revision v%d.%d, ", major_rev, minor_rev);
if(esp_flash_get_size(NULL, &flash_size) != ESP_OK) {
printf("Get flash size failed");
return;
Expand Down

0 comments on commit 7f4bcc3

Please sign in to comment.