bsp/samx7x: fix build

Signed-off-by: HiFiPhile <admin@hifiphile.com>
This commit is contained in:
HiFiPhile
2026-02-27 10:43:22 +01:00
parent bd1e79bc6c
commit fc9f63e62d
3 changed files with 19 additions and 11 deletions

View File

@ -1,5 +1,9 @@
set(JLINK_DEVICE SAME70N19B)
set(LD_FILE_GNU ${TOP}/hw/mcu/microchip/same70/same70b/gcc/gcc/same70q21b_flash.ld)
set(LD_FILE_GNU ${TOP}/hw/mcu/microchip/same70/same70b/gcc/gcc/same70n19b_flash.ld)
set(LD_FILE_IAR ${TOP}/hw/mcu/microchip/same70/same70b/iar/config/linker/Microchip/atsame70n19b/flash.icf)
set(STARTUP_FILE_GNU ${TOP}/hw/mcu/microchip/same70/same70b/gcc/gcc/startup_same70n19b.c)
set(STARTUP_FILE_IAR ${TOP}/hw/mcu/microchip/same70/same70b/iar/iar/startup_same70n19b.c)
function(update_board TARGET)
target_compile_definitions(${TARGET} PUBLIC

View File

@ -1,5 +1,9 @@
set(JLINK_DEVICE SAME70Q21B)
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)
set(STARTUP_FILE_GNU ${TOP}/hw/mcu/microchip/same70/same70b/gcc/gcc/startup_same70q21b.c)
set(STARTUP_FILE_IAR ${TOP}/hw/mcu/microchip/same70/same70b/iar/iar/startup_same70q21b.c)
function(update_board TARGET)
target_compile_definitions(${TARGET} PUBLIC

View File

@ -13,7 +13,6 @@ set(FAMILY_MCUS SAMX7X CACHE INTERNAL "")
#------------------------------------
# Startup & Linker script
#------------------------------------
set(STARTUP_FILE_GNU ${SDK_DIR}/same70b/gcc/gcc/startup_same70q21b.c)
set(STARTUP_FILE_Clang ${STARTUP_FILE_GNU})
set(LD_FILE_Clang ${LD_FILE_GNU})
@ -47,12 +46,9 @@ 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 (TOOLCHAIN STREQUAL "gcc" OR TOOLCHAIN STREQUAL "clang")
set_target_properties(${BOARD_TARGET} PROPERTIES COMPILE_FLAGS -Wno-error=cast-qual)
endif ()
endfunction()
#------------------------------------
@ -89,9 +85,13 @@ function(family_configure_example TARGET RTOS)
"LINKER:--config=${LD_FILE_IAR}"
)
endif ()
set_source_files_properties(${STARTUP_FILE_${CMAKE_C_COMPILER_ID}} PROPERTIES
SKIP_LINTING ON
COMPILE_OPTIONS -w)
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
# ignore hal error
set_source_files_properties(${STARTUP_FILE_${CMAKE_C_COMPILER_ID}} ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/family.c
PROPERTIES
SKIP_LINTING ON
COMPILE_OPTIONS -w)
endif()
family_add_bin_hex(${TARGET})
family_flash_jlink(${TARGET})