From 41303245d84b41522e75ea9504b76b5d0153eea7 Mon Sep 17 00:00:00 2001 From: victhor Date: Wed, 15 Jul 2026 12:22:43 +0200 Subject: [PATCH 1/3] fix binary metadata generation --- tools/binary_metadata_template.cpp | 27 ++++++++++++++++++--------- tools/generate_binary_metadata.py | 2 +- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/tools/binary_metadata_template.cpp b/tools/binary_metadata_template.cpp index d038c950..e99e21a8 100644 --- a/tools/binary_metadata_template.cpp +++ b/tools/binary_metadata_template.cpp @@ -3,15 +3,24 @@ * DO NOT MODIFY MANUALLY!!! */ extern "C"{ + // about 30 is the maximum but do 32 for alignment + const char COMPILATION_DATE[32] __attribute__((section(".metadata_pool")))= + "20260715T121909"; + + // 16 bytes because short hash is 8 bytes + null terminator + alignment + const char STLIB_COMMIT_HASH[16] __attribute__((section(".metadata_pool")))= + "4b8ea8bb"; + + // 16 bytes because short hash is 8 bytes + null terminator + alignment + const char ADJ_COMMIT_HASH[16] __attribute__((section(".metadata_pool")))= + "4ede3eb3"; + + // 16 bytes because short hash is 8 bytes + null terminator + alignment + const char BOARD_COMMIT_HASH[16] __attribute__((section(".metadata_pool")))= + "55ac2426"; + const char DESCRIPTION[255] __attribute__((section(".metadata_pool")))= "****************" // placeholder for beggining - "{{ DateTimeISO8601 }}" // DateTime using ISO-8601 format - " " // alignment - "{{ STLIB_COMMIT }}" // STLIB commit - "{{ ADJ_COMMIT}}" // ADJ commit - "{{ BOARD_COMMIT }}" // Board commit // the '=' is used for unparsing - {% for var_pair in variables -%} - "{{var_pair.name}}={{var_pair.value}}" - {% endfor %}; -} + ; +} \ No newline at end of file diff --git a/tools/generate_binary_metadata.py b/tools/generate_binary_metadata.py index 3350ea36..a79251e6 100644 --- a/tools/generate_binary_metadata.py +++ b/tools/generate_binary_metadata.py @@ -72,7 +72,7 @@ def main() -> None: iso_time = datetime.now().strftime("%Y%m%dT%H%M%S") stlib_commit = get_current_commit(repo_root / "deps/ST-LIB") - adj_commit = get_current_commit(repo_root / "deps/adj") + adj_commit = get_current_commit(repo_root / "Core/Inc/Code_Generation/JSON_ADE") board_commit = get_current_commit(repo_root) output_file = repo_root / "Core/Src/Runes/generated_metadata.cpp" From 7e256a7986b62b8f54bbb24a7a39cb9b1e148240 Mon Sep 17 00:00:00 2001 From: victhor Date: Wed, 15 Jul 2026 12:27:21 +0200 Subject: [PATCH 2/3] formatting --- tools/binary_metadata_template.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/binary_metadata_template.cpp b/tools/binary_metadata_template.cpp index e99e21a8..a9b8e29c 100644 --- a/tools/binary_metadata_template.cpp +++ b/tools/binary_metadata_template.cpp @@ -23,4 +23,4 @@ extern "C"{ "****************" // placeholder for beggining // the '=' is used for unparsing ; -} \ No newline at end of file +} From 90eef0373be7347b4ac555a753bfe1b2979f2626 Mon Sep 17 00:00:00 2001 From: victhor Date: Wed, 15 Jul 2026 16:02:21 +0200 Subject: [PATCH 3/3] fix binary metadata template (again) --- tools/binary_metadata_template.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/tools/binary_metadata_template.cpp b/tools/binary_metadata_template.cpp index a9b8e29c..a3968b8d 100644 --- a/tools/binary_metadata_template.cpp +++ b/tools/binary_metadata_template.cpp @@ -4,23 +4,21 @@ */ extern "C"{ // about 30 is the maximum but do 32 for alignment - const char COMPILATION_DATE[32] __attribute__((section(".metadata_pool")))= - "20260715T121909"; + const char COMPILATION_DATE[32] = "{{ DateTimeISO8601 }}"; // 16 bytes because short hash is 8 bytes + null terminator + alignment - const char STLIB_COMMIT_HASH[16] __attribute__((section(".metadata_pool")))= - "4b8ea8bb"; + const char STLIB_COMMIT_HASH[16] = "{{ STLIB_COMMIT }}"; // 16 bytes because short hash is 8 bytes + null terminator + alignment - const char ADJ_COMMIT_HASH[16] __attribute__((section(".metadata_pool")))= - "4ede3eb3"; + const char ADJ_COMMIT_HASH[16] = "{{ ADJ_COMMIT}}"; // 16 bytes because short hash is 8 bytes + null terminator + alignment - const char BOARD_COMMIT_HASH[16] __attribute__((section(".metadata_pool")))= - "55ac2426"; + const char BOARD_COMMIT_HASH[16] = "{{ BOARD_COMMIT }}"; const char DESCRIPTION[255] __attribute__((section(".metadata_pool")))= "****************" // placeholder for beggining // the '=' is used for unparsing - ; + {% for var_pair in variables -%} + "{{var_pair.name}}={{var_pair.value}}" + {% endfor %}; }