File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3361,5 +3361,9 @@ ifeq ($(BIG_ENDIAN),1)
33613361 CFLAGS+ =-D"BIG_ENDIAN_ORDER"
33623362endif
33633363
3364+ ifeq ($(WOLFBOOT_VERSION_SECTION ) ,)
3365+ CFLAGS+=-DWOLFBOOT_VERSION_SECTION =$(WOLFBOOT_VERSION_SECTION )
3366+ endif
3367+
33643368CFLAGS+ =-DWOLFBOOT_ARCH_$(ARCH )
33653369CFLAGS+ =-DTARGET_$(TARGET )
Original file line number Diff line number Diff line change @@ -113,6 +113,10 @@ extern "C" {
113113# endif
114114#endif
115115
116+ #ifndef WB_STRINGIFY
117+ #define _WB_STRINGIFY_L2 (str ) #str
118+ #define WB_STRINGIFY (str ) _WB_STRINGIFY_L2(str)
119+ #endif
116120
117121/* Helpers for memory alignment */
118122#ifndef XALIGNED
Original file line number Diff line number Diff line change @@ -51,7 +51,13 @@ extern unsigned int _start_text;
5151/**
5252 * @brief wolfBoot version number (used in RAM code).
5353 */
54- static volatile const uint32_t __attribute__((used )) wolfboot_version = WOLFBOOT_VERSION ;
54+ #if defined(VERSION_SECTION )
55+ #define WOLFBOOT_VERSION_SECTION __attribute__((section(WB_STRINGIFY(VERSION_SECTION))))
56+ #else
57+ #define WOLFBOOT_VERSION_SECTION
58+ #endif
59+
60+ static volatile const uint32_t __attribute__((used )) WOLFBOOT_VERSION_SECTION wolfboot_version = WOLFBOOT_VERSION ;
5561/**
5662 * @brief RAM Interrupt Vector table.
5763 */
Original file line number Diff line number Diff line change @@ -126,7 +126,8 @@ extern unsigned int _start_text;
126126extern unsigned int __logical_binary_start ;
127127unsigned int _start_text = (unsigned int )& __logical_binary_start ;
128128#endif
129- static volatile const uint32_t __attribute__((used )) wolfboot_version = WOLFBOOT_VERSION ;
129+
130+ static volatile const uint32_t __attribute__((used )) WOLFBOOT_VERSION_SECTION wolfboot_version = WOLFBOOT_VERSION ;
130131
131132#ifdef EXT_FLASH
132133# ifndef BUFFER_DECLARED
You can’t perform that action at this time.
0 commit comments