@@ -24,6 +24,9 @@ LOG_MODULE_REGISTER(smp_sample);
24
24
25
25
#include "common.h"
26
26
27
+ #include <zephyr/retention/blinfo.h>
28
+ #include <bootutil/image.h>
29
+
27
30
#define STORAGE_PARTITION_LABEL storage_partition
28
31
#define STORAGE_PARTITION_ID FIXED_PARTITION_ID(STORAGE_PARTITION_LABEL)
29
32
@@ -50,6 +53,24 @@ static struct fs_mount_t littlefs_mnt = {
50
53
};
51
54
#endif
52
55
56
+ static void blinfo_bootloader_version (void )
57
+ {
58
+ struct image_version version = {0x00 };
59
+
60
+ int ret = blinfo_lookup (BLINFO_BOOTLOADER_VERSION ,
61
+ (char * )& version ,
62
+ sizeof (struct image_version ));
63
+
64
+ if (ret < 0 ) {
65
+ printf ("blinfo_lookup error: %d\n" , ret );
66
+ } else {
67
+ printf ("bl iv_major: %d\n" , version .iv_major );
68
+ printf ("bl iv_minor: %d\n" , version .iv_minor );
69
+ printf ("bl iv_revision: %d\n" , version .iv_revision );
70
+ printf ("bl iv_build_num: %d\n" , version .iv_build_num );
71
+ }
72
+ }
73
+
53
74
int main (void )
54
75
{
55
76
int rc = STATS_INIT_AND_REG (smp_svr_stats , STATS_SIZE_32 ,
@@ -85,6 +106,8 @@ int main(void)
85
106
*/
86
107
LOG_INF ("build time: " __DATE__ " " __TIME__ );
87
108
109
+ blinfo_bootloader_version ();
110
+
88
111
/* The system work queue handles all incoming mcumgr requests. Let the
89
112
* main thread idle while the mcumgr server runs.
90
113
*/
0 commit comments