Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions arch.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3361,5 +3361,9 @@ ifeq ($(BIG_ENDIAN),1)
CFLAGS+=-D"BIG_ENDIAN_ORDER"
endif

ifneq ($(WOLFBOOT_VERSION_SECTION),)
CFLAGS+=-DVERSION_SECTION=$(WOLFBOOT_VERSION_SECTION)
endif

CFLAGS+=-DWOLFBOOT_ARCH_$(ARCH)
CFLAGS+=-DTARGET_$(TARGET)
10 changes: 10 additions & 0 deletions include/wolfboot/wolfboot.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,16 @@ extern "C" {
# endif
#endif

#ifndef WB_STRINGIFY
#define _WB_STRINGIFY_L2(str) #str
#define WB_STRINGIFY(str) _WB_STRINGIFY_L2(str)
#endif

#if defined(VERSION_SECTION)
#define WOLFBOOT_VERSION_SECTION __attribute__((section(WB_STRINGIFY(VERSION_SECTION))))
#else
#define WOLFBOOT_VERSION_SECTION
#endif

/* Helpers for memory alignment */
#ifndef XALIGNED
Expand Down
2 changes: 1 addition & 1 deletion src/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ extern unsigned int _start_text;
/**
* @brief wolfBoot version number (used in RAM code).
*/
static volatile const uint32_t __attribute__((used)) wolfboot_version = WOLFBOOT_VERSION;
static volatile const uint32_t __attribute__((used)) WOLFBOOT_VERSION_SECTION wolfboot_version = WOLFBOOT_VERSION;
/**
* @brief RAM Interrupt Vector table.
*/
Expand Down
3 changes: 2 additions & 1 deletion src/update_flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ extern unsigned int _start_text;
extern unsigned int __logical_binary_start;
unsigned int _start_text = (unsigned int)&__logical_binary_start;
#endif
static volatile const uint32_t __attribute__((used)) wolfboot_version = WOLFBOOT_VERSION;

static volatile const uint32_t __attribute__((used)) WOLFBOOT_VERSION_SECTION wolfboot_version = WOLFBOOT_VERSION;

#ifdef EXT_FLASH
# ifndef BUFFER_DECLARED
Expand Down
Loading