How to update the project build date and time in the bin file header without make clean and full build.
How to update the project build date and time in the bin file header without make clean and full build.
I am using ESP IDF version 5.3.
If I do a make clean and full build, the build date and time is updated in my project where I reference __DATE__ and __TIME__ as well as in the project bin file header.
But if I don't do a full build, the build date and time do not update.
I know which file I need to "touch" in MY source so that my app always gets the new build, but the file header referenced by OTA does not update. I have also confirmed this with a binary file viewer, see below staring at address 0000:0000 where the red text has the time and date.
e9 05 02 4f b4 55 37 40 ee 00 00 00 09 00 00 00
00 63 00 00 00 00 00 01 20 00 13 3c 1c e3 04 00
32 54 cd ab 00 00 00 00 00 00 00 00 00 00 00 00
31 2e 31 2e 30 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
77 69 6e 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
31 33 3a 31 35 3a 30 30 00 00 00 00 00 00 00 00
53 65 70 20 33 30 20 32 30 32 34 00 00 00 00 00
76 35 2e 33 2d 64 69 72 74 79 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
I am using OTA via HTTPS and am referencing the bin file header build date and time so I need this to be correct for management purposes.
I have seen articles suggesting I need to touch the file ../esp/v5.3/esp-idf/components/app_update/esp_ota_app_desc.c, but I have not found this to make any difference to any references to the build date and time.
Ideas?
If I do a make clean and full build, the build date and time is updated in my project where I reference __DATE__ and __TIME__ as well as in the project bin file header.
But if I don't do a full build, the build date and time do not update.
I know which file I need to "touch" in MY source so that my app always gets the new build, but the file header referenced by OTA does not update. I have also confirmed this with a binary file viewer, see below staring at address 0000:0000 where the red text has the time and date.
e9 05 02 4f b4 55 37 40 ee 00 00 00 09 00 00 00
00 63 00 00 00 00 00 01 20 00 13 3c 1c e3 04 00
32 54 cd ab 00 00 00 00 00 00 00 00 00 00 00 00
31 2e 31 2e 30 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
77 69 6e 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
31 33 3a 31 35 3a 30 30 00 00 00 00 00 00 00 00
53 65 70 20 33 30 20 32 30 32 34 00 00 00 00 00
76 35 2e 33 2d 64 69 72 74 79 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
I am using OTA via HTTPS and am referencing the bin file header build date and time so I need this to be correct for management purposes.
I have seen articles suggesting I need to touch the file ../esp/v5.3/esp-idf/components/app_update/esp_ota_app_desc.c, but I have not found this to make any difference to any references to the build date and time.
Ideas?
Re: How to update the project build date and time in the bin file header without make clean and full build.
If you just change one of your source files by hitting enter to crate a new line somewhere and build it will change the time.
Re: How to update the project build date and time in the bin file header without make clean and full build.
Thanks for responding. I don't understand your response though.
I have to make a change to a file which uses __DATE__ or __TIME__ to get it to recompile this specific file otherwise they do not update.
Making changes to another file will build that file but not globally update __DATE__ and __TIME__?
I understand and can live with this, but I don't know what file to change to rebuild the bin file header which is my question.
I have to make a change to a file which uses __DATE__ or __TIME__ to get it to recompile this specific file otherwise they do not update.
Making changes to another file will build that file but not globally update __DATE__ and __TIME__?
I understand and can live with this, but I don't know what file to change to rebuild the bin file header which is my question.
Re: How to update the project build date and time in the bin file header without make clean and full build.
For conversation sake. Lets say you have main.c
Just open main.c and hit enter anywhere in that file to crate a new line.
Then click build again. It will create a new .bin file with the current date and time.
Just open main.c and hit enter anywhere in that file to crate a new line.
Then click build again. It will create a new .bin file with the current date and time.
Re: How to update the project build date and time in the bin file header without make clean and full build.
Gee that would be great and what I expected originally. But it is not the case.
I have a file called super.cpp which references __DATE__ and __TIME__
If i only change main and then rebuild the project (not clean build), the date and time referenced in super.cpp do not update, (as the contents of super.cpp have not changed and so this file is not recompiled).
If I change super.cpp (trivial like adding a [CR], the rebuild includes recompiling super.cpp and the __DATE__ and __TIME__ are updated.
I have a file called super.cpp which references __DATE__ and __TIME__
If i only change main and then rebuild the project (not clean build), the date and time referenced in super.cpp do not update, (as the contents of super.cpp have not changed and so this file is not recompiled).
If I change super.cpp (trivial like adding a [CR], the rebuild includes recompiling super.cpp and the __DATE__ and __TIME__ are updated.
Re: How to update the project build date and time in the bin file header without make clean and full build.
My bad. I just assumed it was placed in main so you could show it at boot time like I did.
Code: Select all
/* Print chip information */
esp_chip_info_t chip_info;
uint32_t flash_size;
esp_chip_info(&chip_info);
esp_flash_get_size(NULL, &flash_size);
unsigned major_rev = chip_info.revision / 100;
unsigned minor_rev = chip_info.revision % 100;
ESP_LOGI(MAIN_TAG, "IC:%s, Rev v%d.%d", CONFIG_IDF_TARGET, major_rev, minor_rev);
ESP_LOGI(MAIN_TAG, "With %" PRIu32 "MB %s flash", flash_size / (uint32_t)(1024 * 1024), (chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded" : "external");
const esp_partition_t *boot_partition = esp_ota_get_boot_partition();
ESP_LOGI(MAIN_TAG, "Boot Partition: 0x%lx", boot_partition->address);
ESP_LOGI(MAIN_TAG, "Compiled Firmware Info");
ESP_LOGI(MAIN_TAG, "Date: %s", __DATE__);
ESP_LOGI(MAIN_TAG, "Time: %s", __TIME__);
ESP_LOGI(MAIN_TAG, "FW : %s\n\n", __FIRMWARE_REV__);
Re: How to update the project build date and time in the bin file header without make clean and full build.
My questions was specifically "I am using OTA via HTTPS and am referencing the bin file header build date and time so I need this to be correct for management purposes." Obviously the bin header file is not part of main.c
Someone from Espressif must be able to answer this question PLEASE!
Someone from Espressif must be able to answer this question PLEASE!
-
- Posts: 9725
- Joined: Thu Nov 26, 2015 4:08 am
Re: How to update the project build date and time in the bin file header without make clean and full build.
A workaround could be to have a header that you include in any file that refers to __TIME__ and __DATE__. Touch that header and any file that includes it gets updated. You can probably also have cmake do that automatically, though I wouldn't know off the top of my head how to do it.
Re: How to update the project build date and time in the bin file header without make clean and full build.
Thanks but as I said, I already have this solution for MY code, my question is regarding the the IDF framework which generates the bin file header as used in OTA.
Does anyone from Espressif service this forum?
Does anyone from Espressif service this forum?
-
- Posts: 9725
- Joined: Thu Nov 26, 2015 4:08 am
Re: How to update the project build date and time in the bin file header without make clean and full build.
Not sure what more you need to know... you can change __DATE__ etc by making sure the relevant C file gets rebuilt, and the bin should get rebuilt as soon as any source is touched... what more do you need?
Who is online
Users browsing this forum: No registered users and 72 guests