Log: Add __assert_func and __assert_puts
As they are required by Armclang for its assert.o module
Signed-off-by: Antonio de Angelis <antonio.deangelis@arm.com>
Change-Id: I51f4585468cd3337f16e27ebda55ed64ee74f2c9
diff --git a/app_broker/CMakeLists.txt b/app_broker/CMakeLists.txt
index cfa0079..af42301 100644
--- a/app_broker/CMakeLists.txt
+++ b/app_broker/CMakeLists.txt
@@ -163,6 +163,7 @@
target_sources(tfm_test_broker
PRIVATE
+ assert.c
main_ns.c
)
diff --git a/app_broker/assert.c b/app_broker/assert.c
new file mode 100644
index 0000000..648fd6f
--- /dev/null
+++ b/app_broker/assert.c
@@ -0,0 +1,30 @@
+/*
+ * SPDX-FileCopyrightText: Copyright The TrustedFirmware-M Contributors
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+#include <stddef.h>
+#include <assert.h>
+#include "tfm_tests_log_msg.h"
+
+#ifndef __ARMCC_VERSION
+void __assert_func(const char *file, int line, const char *func, const char *reason)
+{
+ LOG_MSG("Assertion failed: (%s), file %s, line %d\r\n", reason, file, line);
+
+ while (1) {
+ ;
+ }
+}
+#else /* __ARMCC_VERSION */
+void __assert_puts(const char *msg)
+{
+ LOG_MSG("%s\r\n", msg);
+
+ while (1) {
+ ;
+ }
+}
+#endif /* __ARMCC_VERSION*/