Skip to content

Commit

Permalink
Updated ATSAM MCU packages
Browse files Browse the repository at this point in the history
  • Loading branch information
StrahinjaJacimovic committed Jun 17, 2024
1 parent 2323298 commit 8bf0af0
Show file tree
Hide file tree
Showing 411 changed files with 171,501 additions and 16 deletions.
13 changes: 12 additions & 1 deletion ARM/gcc_clang/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ include(coreUtils)

add_preinit_lib()

core_files_set(fileListInclude fileDirInclude fileListInstall linkerScript startupFile)
core_files_set(fileListInclude fileDirInclude fileListInstall linkerScript startupFile thirdpartyInstall)

set_delay_parameters(delayParameters)
add_macros(${CMAKE_BINARY_DIR} delay_parameters.h ${delayParameters})
Expand Down Expand Up @@ -124,4 +124,15 @@ install(
PATTERN "*.h"
)

if(thirdpartyInstall)
if(IS_DIRECTORY "system/src/${vendor}/${thirdpartyInstall}")
install(
DIRECTORY "system/src/${vendor}/${thirdpartyInstall}/"
DESTINATION "${CMAKE_INSTALL_PREFIX}/include/core/${MCU_NAME}"
FILES_MATCHING
PATTERN "*.h"
)
endif()
endif()

target_sources(${PROJECT_NAME} PRIVATE ${linkerScript} ${startupFile})
11 changes: 9 additions & 2 deletions ARM/gcc_clang/cmake/coreUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ endfunction()
#############################################################################
## Function to set appropriate linker, startup and source files
#############################################################################
function(core_files_set fileListInclude fileDirInclude fileListInstall linkerScript startupFile)
function(core_files_set fileListInclude fileDirInclude fileListInstall linkerScript startupFile thirdpartyInstall)

set(local_list_include ${fileListInclude})
set(local_list_install ${fileListInstall})
Expand All @@ -194,19 +194,26 @@ function(core_files_set fileListInclude fileDirInclude fileListInstall linkerScr

list(APPEND local_dir_install system/inc/${vendor})
list(APPEND local_dir_install def/${vendor}/${MCU_NAME})
set(${list} ${local_dir_install} PARENT_SCOPE)

# Include mcu based on full mcu name matched
string(TOLOWER ${MCU_NAME} mcu_match)
string(SUBSTRING ${MCU_NAME} 0 8 MCU_NAME_FIRST_8)
string(TOLOWER ${MCU_NAME_FIRST_8} MCU_NAME_FIRST_8_LOWER)

file(GLOB_RECURSE CMAKE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/cmake/${vendor}/*.cmake)
foreach(cmakeFile ${CMAKE_FILES})
include(${cmakeFile})
endforeach()

set(${list} ${local_dir_install} PARENT_SCOPE)

set(${list} ${local_list_include} PARENT_SCOPE)
set(${list} ${local_list_install} PARENT_SCOPE)

if(NOT thirdpartyInstall)
set(${thirdpartyInstall} "" PARENT_SCOPE)
endif()

endfunction()

#############################################################################
Expand Down
4 changes: 3 additions & 1 deletion ARM/gcc_clang/cmake/sam/atsamc20_21.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
if(${MCU_NAME} MATCHES "^ATSAMC20E15A$|^ATSAMC20E16A$|^ATSAMC20E17A$|^ATSAMC20E18A$|^ATSAMC20G15A$|^ATSAMC20G16A$|^ATSAMC20G17A$|^ATSAMC20G18A$|^ATSAMC20J15A$|^ATSAMC20J16A$|^ATSAMC20J17A$|^ATSAMC20J18A$|^ATSAMC20N17A$|^ATSAMC20N18A$|^ATSAMC21E15A$|^ATSAMC21E16A$|^ATSAMC21E17A$|^ATSAMC21E18A$|^ATSAMC21G15A$|^ATSAMC21G16A$|^ATSAMC21G17A$|^ATSAMC21G18A$|^ATSAMC21J15A$|^ATSAMC21J16A$|^ATSAMC21J17A$|^ATSAMC21J18A$|^ATSAMC21N17A$|^ATSAMC21N18A")
set(${linkerScript} linker_scripts/${vendor}/${mcu_match}.ld PARENT_SCOPE)
set(${startupFile} startup/${vendor}/${mcu_match}.c PARENT_SCOPE)
list(APPEND local_list_include system/src/sam/system_samc20_21.c)
list(APPEND local_list_include system/src/sam/atsamc20_21/system_samc20_21.c)
list(APPEND local_list_include common/syscalls.c)
list(APPEND local_dir_install system/src/sam/atsamc20_21/thirdparty/${MCU_NAME_FIRST_8_LOWER})
set(${thirdpartyInstall} atsamc20_21/thirdparty/${MCU_NAME_FIRST_8_LOWER} PARENT_SCOPE)
endif()

9 changes: 6 additions & 3 deletions ARM/gcc_clang/cmake/sam/atsamg51.cmake
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
if(${MCU_NAME} MATCHES "^SAMG51N18A$")
set(${linkerScript} linker_scripts/${vendor}/${mcu_match}.ld PARENT_SCOPE)
set(${startupFile} startup/${vendor}/${mcu_match}.c PARENT_SCOPE)
list(APPEND local_list_include system/src/sam/atsamg51/thirdparty/system_samg51n18.c)
list(APPEND local_list_include system/src/sam/atsamg51/system_samg51n18.c)
list(APPEND local_list_include common/syscalls.c)
list(APPEND local_dir_install system/src/sam/atsamg51/thirdparty/${MCU_NAME_FIRST_8_LOWER})
set(${thirdpartyInstall} atsamg51/thirdparty/${MCU_NAME_FIRST_8_LOWER} PARENT_SCOPE)
endif()

if(${MCU_NAME} MATCHES "^SAMG51G18A$")
set(${linkerScript} linker_scripts/${vendor}/${mcu_match}.ld PARENT_SCOPE)
set(${startupFile} startup/${vendor}/${mcu_match}.c PARENT_SCOPE)
list(APPEND local_list_include system/src/sam/atsamg51/thirdparty/system_samg51g18.c)
list(APPEND local_list_include system/src/sam/atsamg51/system_samg51g18.c)
list(APPEND local_list_include common/syscalls.c)
list(APPEND local_dir_install system/src/sam/atsamg51/thirdparty/${MCU_NAME_FIRST_8_LOWER})
set(${thirdpartyInstall} atsamg51/thirdparty/${MCU_NAME_FIRST_8_LOWER} PARENT_SCOPE)
endif()

9 changes: 6 additions & 3 deletions ARM/gcc_clang/cmake/sam/atsamg53.cmake
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
if(${MCU_NAME} MATCHES "^ATSAMG53N19A$|^ATSAMG53N19B$")
set(${linkerScript} linker_scripts/${vendor}/${mcu_match}.ld PARENT_SCOPE)
set(${startupFile} startup/${vendor}/${mcu_match}.c PARENT_SCOPE)
list(APPEND local_list_include system/src/sam/atsamg53/thirdparty/system_samg53n19.c)
list(APPEND local_list_include system/src/sam/atsamg53/system_samg53n19.c)
list(APPEND local_list_include common/syscalls.c)
list(APPEND local_dir_install system/src/sam/atsamg53/thirdparty/${MCU_NAME_FIRST_8_LOWER})
set(${thirdpartyInstall} atsamg53/thirdparty/${MCU_NAME_FIRST_8_LOWER} PARENT_SCOPE)
endif()

if(${MCU_NAME} MATCHES "^ATSAMG53G19A$|^ATSAMG53G19B$")
set(${linkerScript} linker_scripts/${vendor}/${mcu_match}.ld PARENT_SCOPE)
set(${startupFile} startup/${vendor}/${mcu_match}.c PARENT_SCOPE)
list(APPEND local_list_include system/src/sam/atsamg53/thirdparty/system_samg53g19.c)
list(APPEND local_list_include system/src/sam/atsamg53/system_samg53g19.c)
list(APPEND local_list_include common/syscalls.c)
list(APPEND local_dir_install system/src/sam/atsamg53/thirdparty/${MCU_NAME_FIRST_8_LOWER})
set(${thirdpartyInstall} atsamg53/thirdparty/${MCU_NAME_FIRST_8_LOWER} PARENT_SCOPE)
endif()

13 changes: 9 additions & 4 deletions ARM/gcc_clang/cmake/sam/atsamg54.cmake
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
if(${MCU_NAME} MATCHES "^ATSAMG54J19B$")
set(${linkerScript} linker_scripts/${vendor}/${mcu_match}.ld PARENT_SCOPE)
set(${startupFile} startup/${vendor}/${mcu_match}.c PARENT_SCOPE)
list(APPEND local_list_include system/src/sam/atsamg54/thirdparty/system_samg54j19.c)
list(APPEND local_list_include system/src/sam/atsamg54/system_samg54j19.c)
list(APPEND local_list_include common/syscalls.c)
list(APPEND local_dir_install system/src/sam/atsamg54/thirdparty/${MCU_NAME_FIRST_8_LOWER})
set(${thirdpartyInstall} atsamg54/thirdparty/${MCU_NAME_FIRST_8_LOWER} PARENT_SCOPE)
endif()

if(${MCU_NAME} MATCHES "^ATSAMG54G19B$")
set(${linkerScript} linker_scripts/${vendor}/${mcu_match}.ld PARENT_SCOPE)
set(${startupFile} startup/${vendor}/${mcu_match}.c PARENT_SCOPE)
list(APPEND local_list_include system/src/sam/atsamg54/thirdparty/system_samg54g19.c)
list(APPEND local_list_include system/src/sam/atsamg54/system_samg54g19.c)
list(APPEND local_list_include common/syscalls.c)
list(APPEND local_dir_install system/src/sam/atsamg54/thirdparty/${MCU_NAME_FIRST_8_LOWER})
set(${thirdpartyInstall} atsamg54/thirdparty/${MCU_NAME_FIRST_8_LOWER} PARENT_SCOPE)
endif()

if(${MCU_NAME} MATCHES "^ATSAMG54N19B$")
set(${linkerScript} linker_scripts/${vendor}/${mcu_match}.ld PARENT_SCOPE)
set(${startupFile} startup/${vendor}/${mcu_match}.c PARENT_SCOPE)
list(APPEND local_list_include system/src/sam/atsamg54/thirdparty/system_samg54n19.c)
list(APPEND local_list_include system/src/sam/atsamg54/system_samg54n19.c)
list(APPEND local_list_include common/syscalls.c)
list(APPEND local_dir_install system/src/sam/atsamg54/thirdparty/${MCU_NAME_FIRST_8_LOWER})
set(${thirdpartyInstall} atsamg54/thirdparty/${MCU_NAME_FIRST_8_LOWER} PARENT_SCOPE)
endif()

8 changes: 6 additions & 2 deletions ARM/gcc_clang/cmake/sam/atsamg55.cmake
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
if(${MCU_NAME} MATCHES "^ATSAMG55G19A$|^ATSAMG55G19B$")
set(${linkerScript} linker_scripts/${vendor}/${mcu_match}.ld PARENT_SCOPE)
set(${startupFile} startup/${vendor}/${mcu_match}.c PARENT_SCOPE)
list(APPEND local_list_include system/src/sam/atsamg55/thirdparty/system_samg55g19.c)
list(APPEND local_list_include system/src/sam/atsamg55/system_samg55g19.c)
list(APPEND local_list_include common/syscalls.c)
list(APPEND local_dir_install system/src/sam/atsamg55/thirdparty/${MCU_NAME_FIRST_8_LOWER})
set(${thirdpartyInstall} atsamg55/thirdparty/${MCU_NAME_FIRST_8_LOWER} PARENT_SCOPE)
endif()

if(${MCU_NAME} MATCHES "^ATSAMG55J19A$|^ATSAMG55J19B$")
set(${linkerScript} linker_scripts/${vendor}/${mcu_match}.ld PARENT_SCOPE)
set(${startupFile} startup/${vendor}/${mcu_match}.c PARENT_SCOPE)
list(APPEND local_list_include system/src/sam/atsamg55/thirdparty/system_samg55j19.c)
list(APPEND local_list_include system/src/sam/atsamg55/system_samg55j19.c)
list(APPEND local_list_include common/syscalls.c)
list(APPEND local_dir_install system/src/sam/atsamg55/thirdparty/${MCU_NAME_FIRST_8_LOWER})
set(${thirdpartyInstall} atsamg55/thirdparty/${MCU_NAME_FIRST_8_LOWER} PARENT_SCOPE)
endif()
Loading

0 comments on commit 8bf0af0

Please sign in to comment.