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+ ifneq ($(WOLFBOOT_VERSION_SECTION ) ,)
3365+ CFLAGS+=-DVERSION_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,16 @@ 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
120+
121+ #if defined(VERSION_SECTION )
122+ #define WOLFBOOT_VERSION_SECTION __attribute__((section(WB_STRINGIFY(VERSION_SECTION))))
123+ #else
124+ #define WOLFBOOT_VERSION_SECTION
125+ #endif
116126
117127/* Helpers for memory alignment */
118128#ifndef XALIGNED
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ 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+ static volatile const uint32_t __attribute__((used )) WOLFBOOT_VERSION_SECTION wolfboot_version = WOLFBOOT_VERSION ;
5555/**
5656 * @brief RAM Interrupt Vector table.
5757 */
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