diff --git a/Test/shimmer_test.c b/Test/shimmer_test.c index 36cfb6ab..7a58c91e 100644 --- a/Test/shimmer_test.c +++ b/Test/shimmer_test.c @@ -12,6 +12,7 @@ #include #include "log_and_stream_includes.h" +#include "version.h" factory_test_target_t factoryTestTarget = PRINT_TO_DEBUGGER; factory_test_t factoryTestToRun; @@ -23,6 +24,11 @@ uint32_t ShimFactoryTest_run(void) ShimFactoryTest_sendReport("//**************************** TEST START " "************************************//\r\n"); + /* Record the firmware version running this test so the captured report + * documents exactly which build was used for testing. FW_VERSION_STRING is + * the compile-time version baked into this binary. Prints on every report. */ + ShimFactoryTest_sendReport("Firmware version: " FW_VERSION_STRING "\r\n"); + shimmerStatus.testResult = 0; if (factoryTestToRun == FACTORY_TEST_LED_STATES) diff --git a/scripts/increment_version.sh b/scripts/increment_version.sh index cd16b756..f4088ff0 100644 --- a/scripts/increment_version.sh +++ b/scripts/increment_version.sh @@ -109,8 +109,10 @@ typedef struct uint8_t patch; } firmware_version_t; -__attribute__((section(".version"), used)) static const firmware_version_t fw_version_struct - = { .major = FW_VERSION_MAJOR, .minor = FW_VERSION_MINOR, .patch = FW_VERSION_PATCH }; +/* The definition lives in each firmware's main.c so this header can be included + * by multiple translation units without emitting a duplicate object into the + * .version linker section. */ +extern const firmware_version_t fw_version_struct; #endif //VERSION_H EOF