aboutsummaryrefslogtreecommitdiff
path: root/STM32F429ZIT6_HelloWorld/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'STM32F429ZIT6_HelloWorld/CMakeLists.txt')
-rw-r--r--STM32F429ZIT6_HelloWorld/CMakeLists.txt23
1 files changed, 23 insertions, 0 deletions
diff --git a/STM32F429ZIT6_HelloWorld/CMakeLists.txt b/STM32F429ZIT6_HelloWorld/CMakeLists.txt
new file mode 100644
index 0000000..8f02a0b
--- /dev/null
+++ b/STM32F429ZIT6_HelloWorld/CMakeLists.txt
@@ -0,0 +1,23 @@
+cmake_minimum_required(VERSION 3.21)
+project(STM32 C ASM)
+
+set(CMAKE_VERBOSE_MAKEFILE ON)
+
+set(CMAKE_C_COMPILER arm-none-eabi-gcc)
+set(CMAKE_CXX_COMPILER arm-none-eabi-g++)
+set(CMAKE_ASM_COMPILER arm-none-eabi-gcc)
+set(CMAKE_AR arm-none-eabi-ar)
+set(CMAKE_OBJCOPY arm-none-eabi-objcopy)
+set(CMAKE_OBJDUMP arm-none-eabi-objdump)
+set(SIZE arm-none-eabi-size)
+
+set(CMAKE_C_STANDARD 99)
+set(CMAKE_SYSTEM_PROCESSOR cortex-m4)
+
+add_link_options(-Wl,--print-memory-usage,-Map=${PROJECT_BINARY_DIR}/${PROJECT_NAME}.map)
+add_link_options(--specs=nosys.specs)
+add_link_options(-mcpu=${CMAKE_SYSTEM_PROCESSOR} -mthumb -nostdlib)
+add_link_options(-T ${CMAKE_SOURCE_DIR}/linker.ld)
+add_compile_options(-mcpu=${CMAKE_SYSTEM_PROCESSOR} -mthumb)
+add_compile_options(-O0)
+add_executable(STM32 linker.ld core.S boot.S main.c)