MLECO-2984: Refactor components

* Use UART component from Ethos-U core-platform
* Components as cmake project

Change-Id: I053f3a59800abc20216e6a4df8555db357e3f21d
Signed-off-by: Isabella Gottardi <isabella.gottardi@arm.com>
diff --git a/source/hal/profiles/bare-metal/bsp/retarget.c b/source/hal/profiles/bare-metal/bsp/retarget.c
index 9ed3004..ac9b282 100644
--- a/source/hal/profiles/bare-metal/bsp/retarget.c
+++ b/source/hal/profiles/bare-metal/bsp/retarget.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Arm Limited. All rights reserved.
+ * Copyright (c) 2022 Arm Limited. All rights reserved.
  * SPDX-License-Identifier: Apache-2.0
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -64,6 +64,13 @@
 const char __stdout_name[] __attribute__((aligned(4))) = "STDOUT";
 const char __stderr_name[] __attribute__((aligned(4))) = "STDERR";
 
+__attribute__((noreturn)) static void UartEndSimulation(int code)
+{
+    UartPutc((char) 0x4);  // End of simulation
+    UartPutc((char) code); // Exit code
+    while(1);
+}
+
 void _ttywrch(int ch) {
     (void)fputc(ch, stdout);
 }