support IAR build

Signed-off-by: HiFiPhile <admin@hifiphile.com>
This commit is contained in:
HiFiPhile
2025-11-22 00:09:29 +01:00
parent beb432f449
commit cb872b1bda
2 changed files with 12 additions and 6 deletions

View File

@ -1,5 +1,6 @@
set(JLINK_DEVICE ATSAME70Q21B)
set(LD_FILE_GNU ${TOP}/hw/mcu/microchip/same70/same70b/gcc/gcc/same70q21b_flash.ld)
set(LD_FILE_IAR ${TOP}/hw/mcu/microchip/same70/same70b/iar/config/linker/Microchip/atsame70q21b/flash.icf)
function(update_board TARGET)
target_compile_definitions(${TARGET} PUBLIC

View File

@ -15,6 +15,7 @@ set(FAMILY_MCUS SAMX7X CACHE INTERNAL "")
#------------------------------------
set(STARTUP_FILE_GNU ${SDK_DIR}/same70b/gcc/gcc/startup_same70q21b.c)
set(STARTUP_FILE_Clang ${STARTUP_FILE_GNU})
set(STARTUP_FILE_IAR ${SDK_DIR}/same70b/iar/iar/startup_same70q21b.c)
set(LD_FILE_Clang ${LD_FILE_GNU})
#------------------------------------
@ -47,12 +48,14 @@ function(family_add_board BOARD_TARGET)
update_board(${BOARD_TARGET})
target_compile_options(${BOARD_TARGET} PUBLIC
-Wno-error=unused-parameter
-Wno-error=cast-align
-Wno-error=redundant-decls
-Wno-error=cast-qual
)
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_compile_options(${BOARD_TARGET} PUBLIC
-Wno-error=unused-parameter
-Wno-error=cast-align
-Wno-error=redundant-decls
-Wno-error=cast-qual
)
endif()
endfunction()
#------------------------------------
@ -89,9 +92,11 @@ function(family_configure_example TARGET RTOS)
"LINKER:--config=${LD_FILE_IAR}"
)
endif ()
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
set_source_files_properties(${STARTUP_FILE_${CMAKE_C_COMPILER_ID}} PROPERTIES
SKIP_LINTING ON
COMPILE_OPTIONS -w)
endif()
family_add_bin_hex(${TARGET})
family_flash_jlink(${TARGET})