Change in simtrace2[master]: firmware: do not allow undefined symbols

laforge gerrit-no-reply at
Sun Apr 4 16:16:24 UTC 2021

laforge has submitted this change. ( )

Change subject: firmware: do not allow undefined symbols

firmware: do not allow undefined symbols

For some reason undefined symbols were downgraded to warnings, which
means building a firmware that calls missing functions  (= address zero)
was perfectly fine, which of course made development more exciting....

This applies to builtins, too, printf of one char gets downgraded to
putchar, which we don't have, so disable builtins.

Change-Id: I492f41ad4162b9d07b1881ae4aed019db2dff8b5
M firmware/Makefile
M firmware/libboard/common/source/board_lowlevel.c
2 files changed, 7 insertions(+), 2 deletions(-)

  laforge: Looks good to me, approved
  fixeria: Looks good to me, but someone else must approve
  Jenkins Builder: Verified

diff --git a/firmware/Makefile b/firmware/Makefile
index ccf5843..cc40673 100644
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -164,14 +164,14 @@
 # -mlong-calls  -Wall
 #CFLAGS += -save-temps -fverbose-asm
 #CFLAGS += -Wa,-a,-ad
+CFLAGS += -D__ARM -fno-builtin
 CFLAGS += --param max-inline-insns-single=500 -mcpu=cortex-m3 -mthumb # -mfix-cortex-m3-ldrd
 ASFLAGS = -mcpu=cortex-m3 -mthumb -Wall -g $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) -D__ASSEMBLY__
-LDFLAGS = -mcpu=cortex-m3 -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=ResetException -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--print-memory-usage $(LIB)
+LDFLAGS = -mcpu=cortex-m3 -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=ResetException -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--print-memory-usage -Wl,--no-undefined $(LIB)
 #LD_OPTIONAL=-Wl,--print-gc-sections -Wl,--stats
 # Append BIN directories to output filename
diff --git a/firmware/libboard/common/source/board_lowlevel.c b/firmware/libboard/common/source/board_lowlevel.c
index b4d7d32..1ddbcba 100644
--- a/firmware/libboard/common/source/board_lowlevel.c
+++ b/firmware/libboard/common/source/board_lowlevel.c
@@ -218,3 +218,8 @@
 	do {
 	} while ((jiffies - jiffies_start) < msecs);
+void abort() {
+	NVIC_SystemReset();
+	while(1) {};

To view, visit
To unsubscribe, or for help writing mail filters, visit

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I492f41ad4162b9d07b1881ae4aed019db2dff8b5
Gerrit-Change-Number: 23609
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge at>
Gerrit-Reviewer: Hoernchen <ewild at>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at>
Gerrit-Reviewer: laforge <laforge at>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gerrit-log mailing list