Skip to content
Snippets Groups Projects
Commit 05122e89 authored by Edward Longman's avatar Edward Longman
Browse files

Add CMakeFiles for ti provided code

parent c97b8179
No related branches found
No related tags found
No related merge requests found
# Source based off https://git.soton.ac.uk/sts1u16/iclib/ -> common.cmake
# paths
set(CMAKE_TOOLCHAIN_FILE
${CMAKE_CURRENT_LIST_DIR}/msp430-toolchain.cmake)
# Force compiler detection so we can set up flags
enable_language(C)
include_directories($ENV{MSP_GCC_ROOT}/include) # MSP430 headers
add_compile_options(
-std=c99
-mcpu=msp430
-mmcu=msp430fr5994
-msmall
-mhwmult=none
-fno-common
-Wall
)
# Linker scripts
#set(CMAKE_EXE_LINKER_FLAGS
# "${CMAKE_EXE_LINKER_FLAGS} -T ${CMAKE_SOURCE_DIR}/../msp430fr5994.ld ")
# Add to search path for linker scripts (xx_symbols.ld, included by main linker script)
link_directories(
$ENV{MSP430_GCC_ROOT}/include
$ENV{MSP430_GCC_ROOT}/msp430-elf/lib/430/
$ENV{MSP430_GCC_ROOT}/lib/gcc/msp430-elf/7.3.1/430
)
# Toolchain cmake file for msp430-gcc toolchain
# See https://git.soton.ac.uk/sts1u16/iclib/tree/fused-dev
INCLUDE(CMakeForceCompiler)
# Find toolchain programs
find_program(MSP430-GCC msp430-elf-gcc $ENV{MSP430_GCC_ROOT}/bin)
find_program(MSP430-GXX msp430-elf-g++ $ENV{MSP430_GCC_ROOT}/bin)
find_program(MSP430-OBJCOPY msp430-elf-objcopy $ENV{MSP430_GCC_ROOT}/bin)
# find_program(MSP430-SIZE msp430-elf-size $ENV{MSP430_GCC_ROOT}/bin) # No size function on my system
find_program(MSP430-OBJDUMP msp430-elf-objdump $ENV{MSP430_GCC_ROOT}/bin)
find_program(MSPDEBUG mspdebug)
# Define toolchain
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_ASM_COMPILER ${MSP430-GCC} CACHE INTERNAL "")
set(CMAKE_C_COMPILER ${MSP430-GCC} CACHE INTERNAL "")
set(CMAKE_CXX_COMPIER ${MSP430-GXX} CACHE INTERNAL "")
# Prevent CMake from testing the compilers
set(CMAKE_C_COMPILER_WORKS 1 CACHE INTERNAL "")
set(CMAKE_CXX_COMPILER_WORKS 1 CACHE INTERNAL "")
#Debug by default
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
endif(NOT CMAKE_BUILD_TYPE)
function(add_msp_upload EXECUTABLE)
add_custom_target(upload_${EXECUTABLE}
COMMAND ${MSPDEBUG} tilib "prog ${EXECUTABLE}.elf"
DEPENDS ${EXECUTABLE})
endfunction(add_msp_upload)
cmake_minimum_required(VERSION 2.8)
include(${CMAKE_CURRENT_LIST_DIR}/../common.cmake)
add_subdirectory(lib)
project(radio_power_test)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
include_directories(
${MSP_GCC_ROOT}/include
${CMAKE_SOURCE_DIR}
)
link_directories(
${MSP_GCC_ROOT}/include
)
add_executable(${PROJECT_NAME}_rxer test/main_txer.c)
target_link_libraries(${PROJECT_NAME}_rxer hal_mcu )
add_executable(${PROJECT_NAME}_txer test/main_rxer.c)
target_compile_definitions(${PROJECT_NAME}_rxer PUBLIC TXER)
target_link_libraries(${PROJECT_NAME}_txer hibernus zeta util spi)
cmake_minimum_required(VERSION 2.8)
include(${CMAKE_SOURCE_DIR}/../common.cmake)
add_subdirectory(hal_mcu)
add_subdirectory(radio_drv)
cmake_minimum_required(VERSION 2.8)
include(${CMAKE_SOURCE_DIR}/../common.cmake)
add_library(
hal_mcu
STATIC
hal_f2_timerA0.c
hal_f2_timerB0.c
hal_f5_timerB0.c
hal_mcu.c
)
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
*******************************************************************************/ *******************************************************************************/
#include "msp430.h" #include "msp430.h"
#include "../hal_spi/hal_spi_rf.h" #include "../radio_drv/hal_spi_rf.h"
#if defined (__MSP430F5438A__) #if defined (__MSP430F5438A__)
/******************************************************************************* /*******************************************************************************
......
cmake_minimum_required(VERSION 2.8)
include(${CMAKE_SOURCE_DIR}/../common.cmake)
add_library(
radio_drv
STATIC
hal_spi_rf.c
cc1190_drv/cc1190_drv.c
cc1101_drv/cc1101_drv.c
cc1101_drv/cc1101_utils.c
cc112x_drv/cc112x_drv.c
cc112x_drv/cc112x_utils.c
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment