Skip to content
Merged
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 @@ -3595,5 +3595,9 @@ ifeq ($(BIG_ENDIAN),1)
CFLAGS+=-D"BIG_ENDIAN_ORDER"
endif

ifneq ($(WOLFBOOT_VERSION_SECTION),)
CFLAGS+=-DVERSION_SECTION=$(WOLFBOOT_VERSION_SECTION)
Comment thread
dgarske marked this conversation as resolved.
Resolved
endif

CFLAGS+=-DWOLFBOOT_ARCH_$(ARCH)
CFLAGS+=-DTARGET_$(TARGET)
14 changes: 14 additions & 0 deletions include/wolfboot/wolfboot.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,20 @@ 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)
#if defined(__IAR_SYSTEMS_ICC__)
#define WOLFBOOT_VERSION_SECTION(name) __section(WB_STRINGIFY(VERSION_SECTION))
#else
#define WOLFBOOT_VERSION_SECTION(name) __attribute__((section(WB_STRINGIFY(VERSION_SECTION))))
#endif
#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 @@ -133,7 +133,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;
Comment thread
dgarske marked this conversation as resolved.
Resolved

#ifdef EXT_FLASH
# ifndef BUFFER_DECLARED
Expand Down
1 change: 1 addition & 0 deletions tools/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ CONFIG_VARS:= ARCH TARGET SIGN HASH MCUXSDK MCUXPRESSO MCUXPRESSO_CPU MCUXPRESSO
WOLFBOOT_PARTITION_SWAP_ADDRESS WOLFBOOT_LOAD_ADDRESS \
WOLFBOOT_LOAD_DTS_ADDRESS WOLFBOOT_LOAD_RAMDISK_ADDRESS \
WOLFBOOT_LOAD_KERNEL_ADDRESS \
WOLFBOOT_VERSION_SECTION \
DDR_HIGH_BASE DDR_HIGH_SIZE NO_DDR_LOW \
BOOT_EL1 BOOT_EL2 \
WOLFBOOT_DTS_BOOT_ADDRESS WOLFBOOT_DTS_UPDATE_ADDRESS \
Expand Down
Loading