From 9e489e4a577a6643d9da78291f43eb67429c6b12 Mon Sep 17 00:00:00 2001 From: "D.R.racer" Date: Wed, 14 Apr 2021 09:16:55 +0200 Subject: [PATCH] Set correct MCU ID + output HEX files --- CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d4d4526..f395e78 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -124,8 +124,10 @@ else() endif() if(CMAKE_CROSSCOMPILING) - # mcu related settings set(MCU_FLAGS -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16) - # add_compile_options(${MCU_FLAGS}) add_link_options(${MCU_FLAGS}) + # mcu related settings + set(MCU_FLAGS -mmcu=atmega328) + add_compile_options(${MCU_FLAGS}) + add_link_options(${MCU_FLAGS}) # split and gc sections add_compile_options(-ffunction-sections -fdata-sections) @@ -138,7 +140,7 @@ endif() # enable all warnings (well, not all, but some) add_compile_options(-Wall -Wsign-compare) -add_compile_options($<$:-Wno-register> $<$:-std=c++14>) +add_compile_options($<$:-std=c++14>) # support _DEBUG macro (some code uses to recognize debug builds) if(CMAKE_BUILD_TYPE STREQUAL "Debug") @@ -164,7 +166,7 @@ add_executable(firmware) set_target_properties(firmware PROPERTIES CXX_STANDARD 14) # generate firmware.bin file -objcopy(firmware "binary" ".bin") +objcopy(firmware "ihex" ".hex") # generate linker map file target_link_options(firmware PUBLIC -Wl,-Map=firmware.map)