Skip to content

Commit c4d49cd

Browse files
committed
Fix emu-test-apps linker scripts
1 parent 47ad6c2 commit c4d49cd

9 files changed

Lines changed: 21 additions & 10 deletions

File tree

src/image.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2202,7 +2202,7 @@ int wolfBoot_verify_authenticity(struct wolfBoot_image *img)
22022202
wolfBoot_printf("Verification of hybrid signature\n");
22032203
wolfBoot_verify_signature_secondary(key_slot, img,
22042204
stored_secondary_signature);
2205-
(void)stored_secondary_signature_size;
2205+
(void)stored_secondary_signature_size;
22062206
wolfBoot_printf("Done.\n");
22072207
}
22082208
}

test-app/emu-test-apps/mcxw71/target.ld.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
MEMORY
2424
{
2525
FLASH (rx) : ORIGIN = @FLASH_ORIGIN@, LENGTH = 0x000FFF00
26-
RAM (rwx) : ORIGIN = @FLASH_ORIGIN@, LENGTH = 0x0001C000
26+
RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 0x00006000
2727
}
2828

2929
_estack = ORIGIN(RAM) + LENGTH(RAM);

test-app/emu-test-apps/nrf5340/target.ld.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
MEMORY
2424
{
2525
FLASH (rx) : ORIGIN = @FLASH_ORIGIN@, LENGTH = 0x000FFF00
26-
RAM (rwx) : ORIGIN = @FLASH_ORIGIN@, LENGTH = 0x00080000
26+
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00080000
2727
}
2828

2929
_estack = ORIGIN(RAM) + LENGTH(RAM);

test-app/emu-test-apps/stm32h563/target.ld.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
MEMORY
2424
{
2525
FLASH (rx) : ORIGIN = @FLASH_ORIGIN@, LENGTH = 0x001FFF00
26-
RAM (rwx) : ORIGIN = @FLASH_ORIGIN@, LENGTH = 0x000A0000
26+
RAM (rwx) : ORIGIN = 0x20050000, LENGTH = 0x00040000
2727
}
2828

2929
_estack = ORIGIN(RAM) + LENGTH(RAM);

test-app/emu-test-apps/stm32h563/target_v8.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
MEMORY
2424
{
2525
FLASH (rx) : ORIGIN = 0x8060100, LENGTH = 0x001FFF00
26-
RAM (rwx) : ORIGIN = 0x8060100, LENGTH = 0x000A0000
26+
RAM (rwx) : ORIGIN = 0x20050000, LENGTH = 0x00040000
2727
}
2828

2929
_estack = ORIGIN(RAM) + LENGTH(RAM);

test-app/emu-test-apps/stm32l552/target.ld.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
MEMORY
2424
{
2525
FLASH (rx) : ORIGIN = @FLASH_ORIGIN@, LENGTH = 0x0007FF00
26-
RAM (rwx) : ORIGIN = @FLASH_ORIGIN@, LENGTH = 0x00040000
26+
RAM (rwx) : ORIGIN = 0x20020000, LENGTH = 0x00020000
2727
}
2828

2929
_estack = ORIGIN(RAM) + LENGTH(RAM);

test-app/emu-test-apps/stm32u585/target.ld.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
MEMORY
2424
{
2525
FLASH (rx) : ORIGIN = @FLASH_ORIGIN@, LENGTH = 0x001FFF00
26-
RAM (rwx) : ORIGIN = @FLASH_ORIGIN@, LENGTH = 0x000C0000
26+
RAM (rwx) : ORIGIN = 0x20040000, LENGTH = 0x00080000
2727
}
2828

2929
_estack = ORIGIN(RAM) + LENGTH(RAM);

test-app/emu-test-apps/test.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ UPDATE_OFFSET_HEX=$(printf "0x%x" "$UPDATE_OFFSET")
133133
get_check_config_val() {
134134
local key="$1"
135135
local val
136-
make -C "$WOLFBOOT_ROOT/tools/check_config" check_config RAM_CODE=0 >/dev/null
136+
make -C "$WOLFBOOT_ROOT" include/target.h >/dev/null
137+
make -C "$WOLFBOOT_ROOT/tools/check_config" check_config CROSS_COMPILE=arm-none-eabi- RAM_CODE=0 >/dev/null
137138
val="$("$WOLFBOOT_ROOT/tools/check_config/check_config" | grep -m1 "^${key}" | sed 's/.*: *//')"
138139
[[ -n "$val" ]] || die "missing ${key} from tools/check_config output"
139140
echo "0x$val"
@@ -187,6 +188,7 @@ REBOOT_TIMEOUT="${REBOOT_TIMEOUT:-10}"
187188
write_target_ld() {
188189
local tpl=""
189190
local base=""
191+
local emu_tpl=""
190192
local addr
191193
local size
192194
addr=$((BOOT_ADDR + IMAGE_HEADER_SIZE))
@@ -201,6 +203,13 @@ write_target_ld() {
201203
*) die "unsupported TARGET for linker template: $TARGET" ;;
202204
esac
203205

206+
emu_tpl="$EMU_PATH/target.ld.in"
207+
if [[ -f "$emu_tpl" ]]; then
208+
sed -e "s/@FLASH_ORIGIN@/0x$(printf '%x' "$addr")/g" \
209+
"$emu_tpl" > "$EMU_PATH/target.ld"
210+
return 0
211+
fi
212+
204213
if [[ "${TZEN}" == "1" && -f "$WOLFBOOT_ROOT/test-app/${base}-ns.ld" ]]; then
205214
tpl="$WOLFBOOT_ROOT/test-app/${base}-ns.ld"
206215
else

tools/check_config/Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
include ../config.mk
44
include ../../options.mk
55

6+
CROSS_COMPILE?=
7+
CC?=$(CROSS_COMPILE)gcc
68
CFLAGS+=-I. -I../../ -I../../include
79

810
.PHONY: run clean
@@ -12,11 +14,11 @@ run:
1214
$(Q)$(MAKE) check_config
1315

1416
check_config: check_config.o
15-
$(Q)gcc -o $@ $^ $(CFLAGS)
17+
$(Q)$(CC) -o $@ $^ $(CFLAGS)
1618
$(Q)./$@
1719

1820
%.o:%.c
19-
$(Q)gcc -c -o $@ $^ $(CFLAGS)
21+
$(Q)$(CC) -c -o $@ $^ $(CFLAGS)
2022

2123
clean:
2224
$(Q)rm -f check_config *.o

0 commit comments

Comments
 (0)