Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work in TI CC3220SF target #1621

Merged
merged 1 commit into from
May 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
226 changes: 144 additions & 82 deletions CMake/Modules/FindTI_SimpleLink.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,85 +27,147 @@ include(TI_SimpleLink_${TARGET_SERIES}_sources)
# and here the GCC options tuned for the target series
include(TI_SimpleLink_${TARGET_SERIES}_GCC_options)

list(APPEND TI_SimpleLink_INCLUDE_DIRS "${TARGET_BASE_LOCATION}")

if(TARGET_SERIES STREQUAL "CC32xx")

# includes for FreeRTOS
list(APPEND TI_SimpleLink_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/FreeRTOS_Source/lib/include")
list(APPEND TI_SimpleLink_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/FreeRTOS_Source/lib/include/private")
list(APPEND TI_SimpleLink_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/FreeRTOS_Source/lib/FreeRTOS/portable/GCC/ARM_CM3")

# source files for FreeRTOS
set(FreeRTOS_SRCS

# FreeRTOS
event_groups.c
list.c
queue.c
stream_buffer.c
tasks.c
timers.c
port.c
heap_4.c
clock.c
memory.c
mqueue.c
pthread_barrier.c
pthread_cond.c
pthread.c
pthread_mutex.c
pthread_rwlock.c
sched.c
semaphore.c
sleep.c
timer.c
PTLS.c
aeabi_portable.c

HwiPCC32XX_freertos.c
PowerCC32XX_freertos.c
startup_cc32xx_gcc.c
ClockP_freertos.c
DebugP_freertos.c
MutexP_freertos.c
SemaphoreP_freertos.c
SystemP_freertos.c

)

foreach(SRC_FILE ${FreeRTOS_SRCS})
set(FreeRTOS_SCR_FILE SRC_FILE -NOTFOUND)
find_file(FreeRTOS_SCR_FILE ${SRC_FILE}
PATHS

# FreeRTOS
"${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/posix/freertos"
"${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/kernel/tirtos/dpl"
"${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/kernel/freertos/startup"
"${PROJECT_BINARY_DIR}/FreeRTOS_Source/lib/FreeRTOS/portable/MemMang"
"${PROJECT_BINARY_DIR}/FreeRTOS_Source/lib/FreeRTOS/portable/GCC/ARM_CM3"
"${PROJECT_BINARY_DIR}/FreeRTOS_Source/lib/FreeRTOS"

CMAKE_FIND_ROOT_PATH_BOTH
)
# message("${SRC_FILE} >> ${FreeRTOS_SCR_FILE}") # debug helper
list(APPEND TI_SimpleLink_SOURCES ${FreeRTOS_SCR_FILE})
endforeach()

elseif(TARGET_SERIES STREQUAL "CC13x2_26x2")

# includes for TI-RTOS
list(APPEND TI_SimpleLink_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/SimpleLinkCC13x2_26x2SDK_Source/kernel/tirtos/packages")

# includes for XDC Tools
list(APPEND TI_SimpleLink_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/TI_XDCTools_Source/packages")

# need a dummy include for the sources
list(APPEND TI_SimpleLink_SOURCES " ")

endif()

include(FindPackageHandleStandardArgs)

FIND_PACKAGE_HANDLE_STANDARD_ARGS(TI_SimpleLink DEFAULT_MSG TI_SimpleLink_INCLUDE_DIRS TI_SimpleLink_SOURCES)
# # includes for TI_RTOS
# list(APPEND TI_SimpleLink_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/posix/gcc")
# list(APPEND TI_SimpleLink_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/posix/tirtos")
list(APPEND TI_SimpleLink_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSdk_Source/kernel/tirtos/packages")
list(APPEND TI_SimpleLink_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSdk_Source/kernel/tirtos/packages/ti/sysbios")
# list(APPEND TI_SimpleLink_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSdk_Source/kernel/tirtos/packages/ti/sysbios/knl")
# list(APPEND TI_SimpleLink_INCLUDE_DIRS "${TARGET_BASE_LOCATION}")

# # source files for TI_RTOS
# set(TI_RTOS_SRCS

# # TI_RTOS
# ClockP_tirtos.c
# DebugP_tirtos.c
# HwiP_tirtos.c
# MutexP_tirtos.c
# SemaphoreP_tirtos.c
# SwiP_tirtos.c
# SystemP_tirtos.c
# PowerCC32XX_tirtos.c

# # sys/bios
# BIOS.c
# Clock.c
# Event.c
# Idle.c
# Intrinsics.c
# Mailbox.c
# Queue.c
# Semaphore_svc.c
# Semaphore.c
# Swi_smp.c
# Swi.c
# Task_smp.c
# Task_svc.c
# Task.c





# # posix
# clock.c
# mqueue.c
# pthread_barrier.c
# pthread_cond.c
# pthread.c
# pthread_mutex.c
# pthread_rwlock.c
# sched.c
# semaphore.c
# sleep.c
# timer.c


# # HwiPCC32XX_freertos.c
# # PowerCC32XX_freertos.c
# # startup_cc32xx_gcc.c

# )

# foreach(SRC_FILE ${TI_RTOS_SRCS})
# set(TI_RTOS_SCR_FILE SRC_FILE -NOTFOUND)
# find_file(TI_RTOS_SCR_FILE ${SRC_FILE}
# PATHS

# # TI_RTOS
# "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/posix/tirtos"
# "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/kernel/tirtos/packages/ti/dpl"
# "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSdk_Source/kernel/tirtos/packages/ti/sysbios"
# "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSdk_Source/kernel/tirtos/packages/ti/sysbios/knl"

# CMAKE_FIND_ROOT_PATH_BOTH
# )
# # message("${SRC_FILE} >> ${TI_RTOS_SCR_FILE}") # debug helper
# list(APPEND TI_SimpleLink_SOURCES ${TI_RTOS_SCR_FILE})
# endforeach()

# # includes for FreeRTOS
# list(APPEND TI_SimpleLink_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/FreeRTOS_Source/include")
# list(APPEND TI_SimpleLink_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/FreeRTOS_Source/portable/GCC/ARM_CM3")
# list(APPEND TI_SimpleLink_INCLUDE_DIRS "${TARGET_BASE_LOCATION}")

# # source files for FreeRTOS
# set(FreeRTOS_SRCS

# # FreeRTOS
# croutine.c
# event_groups.c
# list.c
# queue.c
# stream_buffer.c
# tasks.c
# timers.c
# port.c
# heap_4.c
# clock.c
# memory.c
# mqueue.c
# pthread_barrier.c
# pthread_cond.c
# pthread.c
# pthread_mutex.c
# pthread_rwlock.c
# sched.c
# semaphore.c
# sleep.c
# timer.c
# PTLS.c
# aeabi_portable.c
# ClockP_freertos.c
# DebugP_freertos.c
# MutexP_freertos.c
# SemaphoreP_freertos.c
# SystemP_freertos.c
# HwiPCC32XX_freertos.c
# PowerCC32XX_freertos.c
# startup_cc32xx_gcc.c

# )

# foreach(SRC_FILE ${FreeRTOS_SRCS})
# set(FreeRTOS_SCR_FILE SRC_FILE -NOTFOUND)
# find_file(FreeRTOS_SCR_FILE ${SRC_FILE}
# PATHS

# # FreeRTOS
# "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/posix/freertos"
# "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/source"
# "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/kernel/freertos/dpl"
# "${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/kernel/freertos/startup"
# "${PROJECT_BINARY_DIR}/FreeRTOS_Source/portable/MemMang"
# "${PROJECT_BINARY_DIR}/FreeRTOS_Source/portable/GCC/ARM_CM3"
# "${PROJECT_BINARY_DIR}/FreeRTOS_Source"

# CMAKE_FIND_ROOT_PATH_BOTH
# )
# # message("${SRC_FILE} >> ${FreeRTOS_SCR_FILE}") # debug helper
# list(APPEND TI_SimpleLink_SOURCES ${FreeRTOS_SCR_FILE})
# endforeach()

# include(FindPackageHandleStandardArgs)

# FIND_PACKAGE_HANDLE_STANDARD_ARGS(TI_SimpleLink DEFAULT_MSG TI_SimpleLink_INCLUDE_DIRS TI_SimpleLink_SOURCES)
1 change: 1 addition & 0 deletions CMake/Modules/TI_SimpleLink_CC13x2_26x2_sources.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ list(APPEND TI_SimpleLink_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/SimpleLinkCC13x2_2
list(APPEND TI_SimpleLink_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/SimpleLinkCC13x2_26x2SDK_Source/ti/devices/cc13x2_cc26x2/driverlib")
list(APPEND TI_SimpleLink_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/SimpleLinkCC13x2_26x2SDK_Source/ti/net")
list(APPEND TI_SimpleLink_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/SimpleLinkCC13x2_26x2SDK_Source/ti/bsd")
list(APPEND TI_SimpleLink_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/SimpleLinkCC13x2_26x2SDK_Source/kernel/tirtos/packages")

# the sources files are pulled into the build in the target CMakelists through the XDS tools command line
2 changes: 1 addition & 1 deletion CMake/Modules/TI_SimpleLink_CC32xx_GCC_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set(CMAKE_ASM_FLAGS " -mthumb -mcpu=cortex-m4 -x assembler-with-cpp" CACHE INTER

# need to specify linker flags here
# -mfpu=fpv5-sp-d16
set(CMAKE_EXE_LINKER_FLAGS " -Wl,--gc-sections -Wl,--no-wchar-size-warning -Wl,--print-memory-usage -mcpu=cortex-m4 -march=armv7e-m -mthumb -nostartfiles -std=c99 -mfloat-abi=soft -ffunction-sections -fdata-sections -g -gstrict-dwarf -Wall " CACHE INTERNAL "executable linker flags")
set(CMAKE_EXE_LINKER_FLAGS " -Wl,--gc-sections -Wl,--no-wchar-size-warning -Wl,--print-memory-usage -mcpu=cortex-m4 -march=armv7e-m -mthumb -nostartfiles -std=c99 -mfloat-abi=soft -ffunction-sections -fdata-sections -g -gstrict-dwarf -Wall -I${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSdk_Source/kernel/tirtos/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/include/newlib-nano -I${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSdk_Source/kernel/tirtos/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/include" CACHE INTERNAL "executable linker flags")


function(NF_SET_COMPILER_OPTIONS TARGET)
Expand Down
Loading