Skip to content

Commit

Permalink
Major rework on GC5 platform files
Browse files Browse the repository at this point in the history
  • Loading branch information
MateuszKlatecki committed Jul 30, 2019
1 parent 54844df commit e6cc2b6
Show file tree
Hide file tree
Showing 194 changed files with 9,073 additions and 14,935 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -665,22 +665,22 @@ elseif(RTOS_FREERTOS_CHECK)

# now add the subdirectory for the board
# try to find board in the targets folder
if(EXISTS ${PROJECT_SOURCE_DIR}/targets/FreeRTOS/NXP/${FREERTOS_BOARD})
if(EXISTS ${PROJECT_SOURCE_DIR}/targets/FreeRTOS/GC5/${FREERTOS_BOARD})
# board found
message(STATUS "Support for target board '${FREERTOS_BOARD}' found")

# add TARGET board directory
add_subdirectory("targets/FreeRTOS/NXP/${FREERTOS_BOARD}")
add_subdirectory("targets/FreeRTOS/GC5/${FREERTOS_BOARD}")

else()

# try to find board in the Community targets folder
if(EXISTS ${PROJECT_SOURCE_DIR}/targets-community/FreeRTOS/NXP/${FREERTOS_BOARD})
if(EXISTS ${PROJECT_SOURCE_DIR}/targets-community/FreeRTOS/GC5/${FREERTOS_BOARD})
# board found
message(STATUS "Support for target board '${FREERTOS_BOARD}' found in Community targets")

# add TARGET board directory from Community
add_subdirectory("targets-community/FreeRTOS/NXP/${FREERTOS_BOARD}")
add_subdirectory("targets-community/FreeRTOS/GC5/${FREERTOS_BOARD}")

else()
# board NOT found in targets folder
Expand Down
10 changes: 5 additions & 5 deletions targets/FreeRTOS/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -413,18 +413,18 @@ else()
endif()

# Define base path for the class libraries
set(BASE_PATH_FOR_CLASS_LIBRARIES_MODULES "${PROJECT_SOURCE_DIR}/targets/FreeRTOS/NXP/nanoCLR")
set(BASE_PATH_FOR_CLASS_LIBRARIES_MODULES "${PROJECT_SOURCE_DIR}/targets/FreeRTOS/GC5/nanoCLR")

# set target base location
# this has to be set before the class library modules are pulled in
if(EXISTS ${PROJECT_SOURCE_DIR}/targets/FreeRTOS/NXP/${FREERTOS_BOARD})
if(EXISTS ${PROJECT_SOURCE_DIR}/targets/FreeRTOS/GC5/${FREERTOS_BOARD})
# set target base location
set(TARGET_BASE_LOCATION "${PROJECT_SOURCE_DIR}/targets/FreeRTOS/NXP/${FREERTOS_BOARD}")
set(TARGET_BASE_LOCATION "${PROJECT_SOURCE_DIR}/targets/FreeRTOS/GC5/${FREERTOS_BOARD}")
else()
# try to find board in the Community targets folder
if(EXISTS ${PROJECT_SOURCE_DIR}/targets-community/FreeRTOS/NXP/${FREERTOS_BOARD})
# set target base location
set(TARGET_BASE_LOCATION "${PROJECT_SOURCE_DIR}/targets-community/FreeRTOS/NXP/${FREERTOS_BOARD}")
set(TARGET_BASE_LOCATION "${PROJECT_SOURCE_DIR}/targets-community/FreeRTOS/GC5/${FREERTOS_BOARD}")
else()
# board NOT found in targets folder
# can't continue
Expand All @@ -434,4 +434,4 @@ endif()

# board folder will be added in main CMakeList

add_subdirectory(NXP)
add_subdirectory(GC5)
36 changes: 36 additions & 0 deletions targets/FreeRTOS/GC5/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#
# Copyright (c) 2019 The nanoFramework project contributors
# See LICENSE file in the project root for full license information.
#

# append FatFS files
if(USE_FILESYSTEM_OPTION)
list(APPEND NANOCLR_PROJECT_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/fatfs/diskio.c")
list(APPEND NANOCLR_PROJECT_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/fatfs/fsl_sd_disk.c")
list(APPEND NANOCLR_PROJECT_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/fatfs/ffsystem.c")

list(APPEND NANOCLR_PROJECT_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/fatfs)

endif()

# append networking files, if enabled
if(USE_NETWORKING_OPTION)
list(APPEND NANOCLR_PROJECT_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/LwIP/ethernetif.c")

list(APPEND NANOCLR_PROJECT_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/LwIP)

# append mbed TLS entropy generator, if hardware has it
# if(NF_SECURITY_MBEDTLS AND USE_RNG)
# list(APPEND NANOCLR_PROJECT_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/mbedtls_entropy_hardware_pool.c")
# endif()

endif()

# make vars global
set(NANOCLR_PROJECT_SOURCES ${NANOCLR_PROJECT_SOURCES} CACHE INTERNAL "make global")
set(NANOCLR_PROJECT_INCLUDE_DIRS ${NANOCLR_PROJECT_INCLUDE_DIRS} CACHE INTERNAL "make global")

# add platform dirs
add_subdirectory(include)
add_subdirectory(common)
add_subdirectory(nanoCLR)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@
cmake_minimum_required(VERSION 3.0)
ENABLE_LANGUAGE(ASM)

configure_file("${CMAKE_CURRENT_SOURCE_DIR}/nanoCLR/target_board.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/nanoCLR/target_board.h" @ONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/nanoBooter/target_board.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/nanoBooter/target_board.h" @ONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/nanoCLR/target_board.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/nanoCLR/target_board.h" @ONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/target_common.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/target_common.h" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/CMake/FreeRTOS_target_os.h.in"
"${CMAKE_BINARY_DIR}/targets/FreeRTOS/UAC18/target_os.h" @ONLY)

set(NANOBOOTER_PROJECT_NAME "nanoBooter")
set(NANOCLR_PROJECT_NAME "nanoCLR")
Expand Down Expand Up @@ -50,7 +48,6 @@ endif()

#######################################

add_subdirectory("common")
add_subdirectory("nanoBooter")
add_subdirectory("nanoCLR")

Expand All @@ -67,7 +64,7 @@ add_executable(
# need to add configuration manager to allow get/store configuration blocks
"${PROJECT_SOURCE_DIR}/src/HAL/nanoHAL_ConfigurationManager.c"

${COMMON_PROJECT_SOURCES}
${TARGET_NXP_COMMON_SOURCES}
${NANOBOOTER_PROJECT_SOURCES}

${FREERTOS_SOURCES}
Expand All @@ -84,7 +81,8 @@ add_executable(

"${CMAKE_CURRENT_SOURCE_DIR}/target_common.c"

${COMMON_PROJECT_SOURCES}
${TARGET_NXP_COMMON_SOURCES}
${TARGET_NXP_NANOCLR_SOURCES}
${NANOCLR_PROJECT_SOURCES}

${FREERTOS_SOURCES}
Expand Down Expand Up @@ -115,20 +113,10 @@ add_dependencies(${NANOCLR_PROJECT_NAME}.elf FreeRTOS CMSIS)
# include common directories
include_directories(
"${CMAKE_CURRENT_BINARY_DIR}"

${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/common
${CMAKE_CURRENT_SOURCE_DIR}/common/board
${CMAKE_CURRENT_SOURCE_DIR}/common/component/serial_manager
${CMAKE_CURRENT_SOURCE_DIR}/common/component/uart
${CMAKE_CURRENT_SOURCE_DIR}/common/device
${CMAKE_CURRENT_SOURCE_DIR}/common/drivers
${CMAKE_CURRENT_SOURCE_DIR}/common/drivers/freertos
${CMAKE_CURRENT_SOURCE_DIR}/common/utilities
${CMAKE_CURRENT_SOURCE_DIR}/common/xip
${CMAKE_CURRENT_SOURCE_DIR}/common/sdmmc/inc
${CMAKE_CURRENT_SOURCE_DIR}/common/sdmmc/port

${CMAKE_CURRENT_SOURCE_DIR}/include
${TARGET_NXP_COMMON_INCLUDE_DIRS}
${TARGET_NXP_NANOCLR_INCLUDE_DIRS}

${PROJECT_SOURCE_DIR}/src/CLR/Core
${PROJECT_SOURCE_DIR}/src/CLR/Include
Expand All @@ -148,7 +136,6 @@ target_include_directories(${NANOBOOTER_PROJECT_NAME}.elf PUBLIC

${TARGET_CMSIS_NANOBOOTER_INCLUDE_DIRS}
${TARGET_FREERTOS_NANOBOOTER_INCLUDE_DIRS}

)

# include directories for nanoCLR
Expand All @@ -170,6 +157,7 @@ target_include_directories(${NANOCLR_PROJECT_NAME}.elf PUBLIC

# includes for LwIP
"${LWIP_INCLUDE_DIRS}"
"${NANOCLR_PROJECT_INCLUDE_DIRS}"

# incudes for Networking and TLS
"${NF_Networking_INCLUDE_DIRS}"
Expand Down
Loading

0 comments on commit e6cc2b6

Please sign in to comment.