Build: Add support for Armclang 6.10 and Armclang 6.11

This patch introduces support for building with Armclang 6.10
and Armclang 6.11. It also fixes a typo inside the cmake build
system files, and rename architecture names to be consistent.

Change-Id: I9b7db4751c225f092e84c85d9d421fa6d158c929
Signed-off-by: Antonio de Angelis <antonio.deangelis@arm.com>
diff --git a/cmake/Common/CompilerArmClang610.cmake b/cmake/Common/CompilerArmClang610.cmake
new file mode 100644
index 0000000..d9fc30e
--- /dev/null
+++ b/cmake/Common/CompilerArmClang610.cmake
@@ -0,0 +1,69 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2018, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+
+#This file contains settings to specify how ARMCLANG shall be used
+
+#Include some dependencies
+Include(Common/CompilerArmClangCommon)
+Include(Common/Utils)
+
+check_armclang_input_vars("6.10")
+
+if(NOT DEFINED ARM_CPU_ARCHITECTURE)
+	set(_NO_ARM_CPU_ARCHITECTURE true)
+elseif (${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv8-M.BASE")
+	string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+	string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m.base")
+	string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+	string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m.base")
+	string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "--cpu=" VAL "--cpu=8-M.Base")
+	string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "--cpu=" VAL "--cpu=8-M.Base")
+elseif(${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv8-M.MAIN")
+	string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+	string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m.main")
+	string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+	string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m.main")
+	string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "--cpu=" VAL "--cpu=8-M.Main")
+	string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "--cpu=" VAL "--cpu=8-M.Main")
+elseif(${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv7-M")
+	string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+	string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m")
+	string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+	string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-march=" VAL "-march=armv7-m")
+	string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "--cpu=" VAL "--cpu=7-M")
+	string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "--cpu=" VAL "--cpu=7-M")
+else()
+	message(FATAL_ERROR "Unknown or unsupported ARM cpu architecture setting.")
+endif()
+
+#Prefer architecture definition over cpu type.
+if(NOT DEFINED ARM_CPU_ARCHITECTURE)
+	if(NOT DEFINED ARM_CPU_TYPE)
+		string_append_unique_item(_NO_ARM_CPU_TYPE true)
+	elseif(${ARM_CPU_TYPE} STREQUAL "Cortex-M3")
+		string_append_unique_item (CMAKE_C_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m3")
+		string_append_unique_item (CMAKE_CXX_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m3")
+		string_append_unique_item (CMAKE_ASM_FLAGS_CPU "--cpu=Cortex-M3")
+		string_append_unique_item (CMAKE_LINK_FLAGS_CPU "--cpu=Cortex-M3")
+	elseif(${ARM_CPU_TYPE} STREQUAL "Cortex-M33")
+		string_append_unique_item (CMAKE_C_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m33")
+		string_append_unique_item (CMAKE_CXX_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m33")
+		string_append_unique_item (CMAKE_ASM_FLAGS_CPU "--cpu=Cortex-M33")
+		string_append_unique_item (CMAKE_LINK_FLAGS_CPU "--cpu=Cortex-M33")
+	elseif(${ARM_CPU_TYPE} STREQUAL "Cortex-M23")
+		string_append_unique_item (CMAKE_C_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m23")
+		string_append_unique_item (CMAKE_CXX_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m23")
+		string_append_unique_item (CMAKE_ASM_FLAGS_CPU "--cpu=Cortex-M23")
+		string_append_unique_item (CMAKE_LINK_FLAGS_CPU "--cpu=Cortex-M23")
+	else()
+		message(FATAL_ERROR "Unknown ARM cpu setting.")
+	endif()
+endif()
+
+if (_NO_ARM_CPU_TYPE AND _NO_ARM_CPU_ARCHITECTURE)
+	message(FATAL_ERROR "Can not set CPU specific compiler flags: neither the ARM CPU type nor the architecture is set.")
+endif()
diff --git a/cmake/Common/CompilerArmClang611.cmake b/cmake/Common/CompilerArmClang611.cmake
new file mode 100644
index 0000000..05368cb
--- /dev/null
+++ b/cmake/Common/CompilerArmClang611.cmake
@@ -0,0 +1,69 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2018, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+
+#This file contains settings to specify how ARMCLANG shall be used
+
+#Include some dependencies
+Include(Common/CompilerArmClangCommon)
+Include(Common/Utils)
+
+check_armclang_input_vars("6.11")
+
+if(NOT DEFINED ARM_CPU_ARCHITECTURE)
+	set(_NO_ARM_CPU_ARCHITECTURE true)
+elseif (${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv8-M.BASE")
+	string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+	string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m.base")
+	string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+	string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m.base")
+	string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "--cpu=" VAL "--cpu=8-M.Base")
+	string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "--cpu=" VAL "--cpu=8-M.Base")
+elseif(${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv8-M.MAIN")
+	string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+	string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m.main")
+	string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+	string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m.main")
+	string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "--cpu=" VAL "--cpu=8-M.Main")
+	string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "--cpu=" VAL "--cpu=8-M.Main")
+elseif(${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv7-M")
+	string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+	string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m")
+	string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+	string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-march=" VAL "-march=armv7-m")
+	string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "--cpu=" VAL "--cpu=7-M")
+	string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "--cpu=" VAL "--cpu=7-M")
+else()
+	message(FATAL_ERROR "Unknown or unsupported ARM cpu architecture setting.")
+endif()
+
+#Prefer architecture definition over cpu type.
+if(NOT DEFINED ARM_CPU_ARCHITECTURE)
+	if(NOT DEFINED ARM_CPU_TYPE)
+		string_append_unique_item(_NO_ARM_CPU_TYPE true)
+	elseif(${ARM_CPU_TYPE} STREQUAL "Cortex-M3")
+		string_append_unique_item (CMAKE_C_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m3")
+		string_append_unique_item (CMAKE_CXX_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m3")
+		string_append_unique_item (CMAKE_ASM_FLAGS_CPU "--cpu=Cortex-M3")
+		string_append_unique_item (CMAKE_LINK_FLAGS_CPU "--cpu=Cortex-M3")
+	elseif(${ARM_CPU_TYPE} STREQUAL "Cortex-M33")
+		string_append_unique_item (CMAKE_C_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m33")
+		string_append_unique_item (CMAKE_CXX_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m33")
+		string_append_unique_item (CMAKE_ASM_FLAGS_CPU "--cpu=Cortex-M33")
+		string_append_unique_item (CMAKE_LINK_FLAGS_CPU "--cpu=Cortex-M33")
+	elseif(${ARM_CPU_TYPE} STREQUAL "Cortex-M23")
+		string_append_unique_item (CMAKE_C_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m23")
+		string_append_unique_item (CMAKE_CXX_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m23")
+		string_append_unique_item (CMAKE_ASM_FLAGS_CPU "--cpu=Cortex-M23")
+		string_append_unique_item (CMAKE_LINK_FLAGS_CPU "--cpu=Cortex-M23")
+	else()
+		message(FATAL_ERROR "Unknown ARM cpu setting.")
+	endif()
+endif()
+
+if (_NO_ARM_CPU_TYPE AND _NO_ARM_CPU_ARCHITECTURE)
+	message(FATAL_ERROR "Can not set CPU specific compiler flags: neither the ARM CPU type nor the architecture is set.")
+endif()
diff --git a/cmake/Common/CompilerArmClang67.cmake b/cmake/Common/CompilerArmClang67.cmake
index c4a5703..44b0029 100644
--- a/cmake/Common/CompilerArmClang67.cmake
+++ b/cmake/Common/CompilerArmClang67.cmake
@@ -13,9 +13,9 @@
 
 check_armclang_input_vars("6.7")
 
-if(NOT DEFINED ARM_CPU_ARHITECTURE)
-	set(_NO_ARM_CPU_ARHITECTURE true)
-elseif (${ARM_CPU_ARHITECTURE} STREQUAL "ARM8-M-BASE")
+if(NOT DEFINED ARM_CPU_ARCHITECTURE)
+	set(_NO_ARM_CPU_ARCHITECTURE true)
+elseif (${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv8-M.BASE")
 	string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
 	string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m.base")
 	#following is to work around an armclang compiler bug that is fixed in 6.10
@@ -24,14 +24,14 @@
 	string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m.base")
 	string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "--cpu=" VAL "--cpu=8-M.Base")
 	string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "--cpu=" VAL "--cpu=8-M.Base")
-elseif(${ARM_CPU_ARHITECTURE} STREQUAL "ARM8-M-MAIN")
+elseif(${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv8-M.MAIN")
 	string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
 	string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m.main")
 	string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
 	string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m.main")
 	string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "--cpu=" VAL "--cpu=8-M.Main")
 	string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "--cpu=" VAL "--cpu=8-M.Main")
-elseif(${ARM_CPU_ARHITECTURE} STREQUAL "V7-M")
+elseif(${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv7-M")
 	string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
 	string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m")
 	string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
@@ -42,8 +42,8 @@
 	message(FATAL_ERROR "Unknown or unsupported ARM cpu architecture setting.")
 endif()
 
-#Prefer arhitecture definition over cpu type.
-if(NOT DEFINED ARM_CPU_ARHITECTURE)
+#Prefer architecture definition over cpu type.
+if(NOT DEFINED ARM_CPU_ARCHITECTURE)
 	if(NOT DEFINED ARM_CPU_TYPE)
 		string_append_unique_item(_NO_ARM_CPU_TYPE true)
 	elseif(${ARM_CPU_TYPE} STREQUAL "Cortex-M3")
@@ -68,6 +68,6 @@
 	endif()
 endif()
 
-if (_NO_ARM_CPU_TYPE AND _NO_ARM_CPU_ARHITECTURE)
+if (_NO_ARM_CPU_TYPE AND _NO_ARM_CPU_ARCHITECTURE)
 	message(FATAL_ERROR "Can not set CPU specific compiler flags: neither the ARM CPU type nor the architecture is set.")
 endif()
diff --git a/cmake/Common/CompilerArmClang69.cmake b/cmake/Common/CompilerArmClang69.cmake
index 99cbda5..de35f32 100644
--- a/cmake/Common/CompilerArmClang69.cmake
+++ b/cmake/Common/CompilerArmClang69.cmake
@@ -13,9 +13,9 @@
 
 check_armclang_input_vars("6.9")
 
-if(NOT DEFINED ARM_CPU_ARHITECTURE)
-	set(_NO_ARM_CPU_ARHITECTURE true)
-elseif (${ARM_CPU_ARHITECTURE} STREQUAL "ARM8-M-BASE")
+if(NOT DEFINED ARM_CPU_ARCHITECTURE)
+	set(_NO_ARM_CPU_ARCHITECTURE true)
+elseif (${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv8-M.BASE")
 	string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
 	string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m.base")
 	#following is to work around an armclang compiler bug that is fixed in 6.10
@@ -24,14 +24,14 @@
 	string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m.base")
 	string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "--cpu=" VAL "--cpu=8-M.Base")
 	string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "--cpu=" VAL "--cpu=8-M.Base")
-elseif(${ARM_CPU_ARHITECTURE} STREQUAL "ARM8-M-MAIN")
+elseif(${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv8-M.MAIN")
 	string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
 	string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m.main")
 	string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
 	string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m.main")
 	string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "--cpu=" VAL "--cpu=8-M.Main")
 	string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "--cpu=" VAL "--cpu=8-M.Main")
-elseif(${ARM_CPU_ARHITECTURE} STREQUAL "V7-M")
+elseif(${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv7-M")
 	string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
 	string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m")
 	string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
@@ -42,8 +42,8 @@
 	message(FATAL_ERROR "Unknown or unsupported ARM cpu architecture setting.")
 endif()
 
-#Prefer arhitecture definition over cpu type.
-if(NOT DEFINED ARM_CPU_ARHITECTURE)
+#Prefer architecture definition over cpu type.
+if(NOT DEFINED ARM_CPU_ARCHITECTURE)
 	if(NOT DEFINED ARM_CPU_TYPE)
 		string_append_unique_item(_NO_ARM_CPU_TYPE true)
 	elseif(${ARM_CPU_TYPE} STREQUAL "Cortex-M3")
@@ -68,6 +68,6 @@
 	endif()
 endif()
 
-if (_NO_ARM_CPU_TYPE AND _NO_ARM_CPU_ARHITECTURE)
+if (_NO_ARM_CPU_TYPE AND _NO_ARM_CPU_ARCHITECTURE)
 	message(FATAL_ERROR "Can not set CPU specific compiler flags: neither the ARM CPU type nor the architecture is set.")
 endif()
diff --git a/cmake/Common/CompilerArmClangCommon.cmake b/cmake/Common/CompilerArmClangCommon.cmake
index 935c879..9b69f8a 100644
--- a/cmake/Common/CompilerArmClangCommon.cmake
+++ b/cmake/Common/CompilerArmClangCommon.cmake
@@ -26,8 +26,8 @@
 		message(WARNING "ARM_TOOL_VARIANT or ARM_PRODUCT_PATH environment variables are not set!")
 	endif()
 
-	if (NOT DEFINED ARM_CPU_ARHITECTURE AND NOT DEFINED ARM_CPU_TYPE)
-		message(FATAL_ERROR "ARM_CPU_TYPE and ARM_CPU_ARHITECTURE is not defined! Please include the CPU specific config file before this one.")
+	if (NOT DEFINED ARM_CPU_ARCHITECTURE AND NOT DEFINED ARM_CPU_TYPE)
+		message(FATAL_ERROR "ARM_CPU_TYPE and ARM_CPU_ARCHITECTURE is not defined! Please include the CPU specific config file before this one.")
 	endif()
 
 endfunction()
diff --git a/cmake/Common/CompilerGNUARM63.cmake b/cmake/Common/CompilerGNUARM63.cmake
index 81c25bc..fad1264 100644
--- a/cmake/Common/CompilerGNUARM63.cmake
+++ b/cmake/Common/CompilerGNUARM63.cmake
@@ -13,19 +13,19 @@
 
 check_gnuarm_input_vars("6.3")
 
-if(NOT DEFINED ARM_CPU_ARHITECTURE)
-	set(_NO_ARM_CPU_ARHITECTURE true)
-elseif (${ARM_CPU_ARHITECTURE} STREQUAL "ARM8-M-BASE")
+if(NOT DEFINED ARM_CPU_ARCHITECTURE)
+	set(_NO_ARM_CPU_ARCHITECTURE true)
+elseif (${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv8-M.BASE")
 	string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m.base")
 	string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m.base")
 	string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m.base")
 	string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m.base")
-elseif(${ARM_CPU_ARHITECTURE} STREQUAL "ARM8-M-MAIN")
+elseif(${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv8-M.MAIN")
 	string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m.main")
 	string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m.main")
 	string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m.main")
 	string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m.main")
-elseif(${ARM_CPU_ARHITECTURE} STREQUAL "V7-M")
+elseif(${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv7-M")
 	string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-march=" VAL "-march=armv7-m")
 	string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-march=" VAL "-march=armv7-m")
 	string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "-march=" VAL "-march=armv7-m")
@@ -34,8 +34,8 @@
 	message(FATAL_ERROR "Unknown or unsupported ARM cpu architecture setting.")
 endif()
 
-#Prefer arhitecture definition over cpu type.
-if(NOT DEFINED ARM_CPU_ARHITECTURE)
+#Prefer architecture definition over cpu type.
+if(NOT DEFINED ARM_CPU_ARCHITECTURE)
 	if(NOT DEFINED ARM_CPU_TYPE)
 		string_append_unique_item(_NO_ARM_CPU_TYPE true)
 	elseif(${ARM_CPU_TYPE} STREQUAL "Cortex-M3")
@@ -58,6 +58,6 @@
 	endif()
 endif()
 
-if (_NO_ARM_CPU_TYPE AND _NO_ARM_CPU_ARHITECTURE)
+if (_NO_ARM_CPU_TYPE AND _NO_ARM_CPU_ARCHITECTURE)
 	message(FATAL_ERROR "Cannot set CPU specific compiler flags: neither the ARM CPU type nor the architecture is set.")
 endif()
diff --git a/cmake/Common/CompilerGNUARMCommon.cmake b/cmake/Common/CompilerGNUARMCommon.cmake
index 6a06781..51945c6 100644
--- a/cmake/Common/CompilerGNUARMCommon.cmake
+++ b/cmake/Common/CompilerGNUARMCommon.cmake
@@ -21,8 +21,8 @@
 		message(FATAL_ERROR "GNUARM version (GNUARM_VER=${GNUARM_VER}) does not match ${MY_VERSION}")
 	endif()
 
-	if (NOT DEFINED ARM_CPU_ARHITECTURE AND NOT DEFINED ARM_CPU_TYPE)
-		message(FATAL_ERROR "ARM_CPU_TYPE and ARM_CPU_ARHITECTURE is not defined! Please include the CPU specific config file before this one.")
+	if (NOT DEFINED ARM_CPU_ARCHITECTURE AND NOT DEFINED ARM_CPU_TYPE)
+		message(FATAL_ERROR "ARM_CPU_TYPE and ARM_CPU_ARCHITECTURE is not defined! Please include the CPU specific config file before this one.")
 	endif()
 
 endfunction()
diff --git a/cmake/Common/CpuM23.cmake b/cmake/Common/CpuM23.cmake
index 19e640b..d903e0c 100644
--- a/cmake/Common/CpuM23.cmake
+++ b/cmake/Common/CpuM23.cmake
@@ -6,6 +6,6 @@
 #-------------------------------------------------------------------------------
 
 #This file gatrhers Cortex-M23 specific settings which control the build system.
-set(ARM_CPU_ARHITECTURE "ARM8-M-BASE")
+set(ARM_CPU_ARCHITECTURE "ARMv8-M.BASE")
 
 set(ARM_CPU_TYPE "Cortex-M23")
diff --git a/cmake/Common/CpuM33.cmake b/cmake/Common/CpuM33.cmake
index 69bafe6..646b98e 100644
--- a/cmake/Common/CpuM33.cmake
+++ b/cmake/Common/CpuM33.cmake
@@ -1,11 +1,11 @@
 #-------------------------------------------------------------------------------
-# Copyright (c) 2017, Arm Limited. All rights reserved.
+# Copyright (c) 2017-2018, Arm Limited. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
 #-------------------------------------------------------------------------------
 
 #This file gathers Cortex-M33 specific settings which control the build system.
-set(ARM_CPU_ARHITECTURE "ARM8-M-MAIN")
+set(ARM_CPU_ARCHITECTURE "ARMv8-M.MAIN")
 
 set(ARM_CPU_TYPE "Cortex-M33")