From 3f4542181ba8640850ee0ae56467fbd7739884fa Mon Sep 17 00:00:00 2001 From: Nanosonde <2073569+nanosonde@users.noreply.github.com> Date: Thu, 15 Oct 2020 16:31:40 +0200 Subject: [PATCH] Clean up --- examples/knx-cc1310/CMakeLists.txt | 2 - examples/knx-cc1310/build.sh | 2 +- examples/knx-cc1310/cmake/FindXdctools.cmake | 23 ---------- examples/knx-cc1310/cmake/README.md | 45 ------------------- examples/knx-cc1310/cmake/efr32mg.cmake | 30 ------------- examples/knx-cc1310/cmake/gdb-helper.cmake | 40 ----------------- examples/knx-cc1310/cmake/openocd-run.gdb.in | 5 --- examples/knx-cc1310/cmake/stlink-run.gdb.in | 6 --- .../knx-cc1310/vscode/launch.json.example | 20 +++++++++ 9 files changed, 21 insertions(+), 152 deletions(-) delete mode 100644 examples/knx-cc1310/cmake/FindXdctools.cmake delete mode 100644 examples/knx-cc1310/cmake/README.md delete mode 100644 examples/knx-cc1310/cmake/efr32mg.cmake delete mode 100644 examples/knx-cc1310/cmake/gdb-helper.cmake delete mode 100644 examples/knx-cc1310/cmake/openocd-run.gdb.in delete mode 100644 examples/knx-cc1310/cmake/stlink-run.gdb.in create mode 100644 examples/knx-cc1310/vscode/launch.json.example diff --git a/examples/knx-cc1310/CMakeLists.txt b/examples/knx-cc1310/CMakeLists.txt index cfb7cd5..e7c57a6 100644 --- a/examples/knx-cc1310/CMakeLists.txt +++ b/examples/knx-cc1310/CMakeLists.txt @@ -13,7 +13,6 @@ include(cc13xx) # Find dependencies find_package(SimpleLinkCC13X0SDK_nortos REQUIRED) -find_package(Xdctools REQUIRED) # # Target @@ -34,7 +33,6 @@ include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/../../src/knx" "${CMAKE_CURRENT_SOURCE_DIR}/RTT" ${SimpleLinkCC13X0SDK_INCLUDE_DIRS} - ${Xdctools_INCLUDE_DIRS} ) add_definitions(-DMASK_VERSION=0x07B0 -Wno-unknown-pragmas) diff --git a/examples/knx-cc1310/build.sh b/examples/knx-cc1310/build.sh index be740ac..bcf3e3c 100755 --- a/examples/knx-cc1310/build.sh +++ b/examples/knx-cc1310/build.sh @@ -1,2 +1,2 @@ -cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_PREFIX_PATH="~/ti/simplelink_cc13x0_sdk_4_10_02_04;~/ti/xdctools_3_51_03_28_core" -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-arm-none-eabi.cmake .. +cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_PREFIX_PATH="~/ti/simplelink_cc13x0_sdk_4_10_02_04" -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-arm-none-eabi.cmake .. diff --git a/examples/knx-cc1310/cmake/FindXdctools.cmake b/examples/knx-cc1310/cmake/FindXdctools.cmake deleted file mode 100644 index 29fa809..0000000 --- a/examples/knx-cc1310/cmake/FindXdctools.cmake +++ /dev/null @@ -1,23 +0,0 @@ -## -## Author: Johannes Bruder -## License: See LICENSE.TXT file included in the project -## -## -## Find TI's xdctools -## - -include(FindPackageHandleStandardArgs) - -# Find the path to xdc headers -find_path(Xdctools_HEADER_DIR NAMES "std.h" PATH_SUFFIXES "packages/xdc") -message("Content of Xdctools_HEADER_DIR:" ${Xdctools_HEADER_DIR}) - -# Set according include path -set(Xdctools_INCLUDE_DIR "${Xdctools_HEADER_DIR}/../../packages") - -message("Content of Xdctools_INCLUDE_DIR:" ${Xdctools_INCLUDE_DIR}) - -find_package_handle_standard_args(Xdctools DEFAULT_MSG - Xdctools_INCLUDE_DIR) - -set(Xdctools_INCLUDE_DIRS ${Xdctools_INCLUDE_DIR}) diff --git a/examples/knx-cc1310/cmake/README.md b/examples/knx-cc1310/cmake/README.md deleted file mode 100644 index 64ab96a..0000000 --- a/examples/knx-cc1310/cmake/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# About - -The aim of this project is to provide a software development environment based on CMake, GCC and openOCD for several bare metal ARM platforms. - -# Requirements - - * CMake >= 3.6 - * GCC arm-none-abi - * Linux Arch: `arm-none-eabi-gcc` `arm-none-eabi-binutils` `arm-none-eabi-newlib` - * Ubuntu packages: Since the package of the official repo is very old it is recommended to use this [PPA](https://launchpad.net/~team-gcc-arm-embedded/+archive/ubuntu/ppa) - -# Features - - * General CMake Toolchain file for arm-none-eabi-gcc - * Target specific extension of Toolchain file - -# Usage - -Add this project as git submodule to your repository: - - git submodule add https://github.com/jobroe/cmake-arm-embedded.git cmake - - -Set the Linker Script and include the target specific cmake module in your project CMakeLists.txt e.g.: - -``` -set(LINKER_SCRIPT "${Gecko_SDK_PATH}/platform/Device/SiliconLabs/EFR32MG12P/Source/GCC/efr32mg12p.ld") - -include(efr32mg) - -``` - -Go to your project root directory, create build directory and enter it: - - mkdir build - - cd build - -run to configure: - - cmake -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-arm-none-eabi.cmake .. - -and finally to build: - - make diff --git a/examples/knx-cc1310/cmake/efr32mg.cmake b/examples/knx-cc1310/cmake/efr32mg.cmake deleted file mode 100644 index 0d14193..0000000 --- a/examples/knx-cc1310/cmake/efr32mg.cmake +++ /dev/null @@ -1,30 +0,0 @@ -## -## Author: Johannes Bruder -## License: See LICENSE.TXT file included in the project -## -## -## EFR32MG target specific CMake file -## - -if(NOT DEFINED LINKER_SCRIPT) - message(FATAL_ERROR "No linker script defined") -endif(NOT DEFINED LINKER_SCRIPT) -message("Linker script: ${LINKER_SCRIPT}") - -#--------------------------------------------------------------------------------------- -# Set target specific compiler/linker flags -#--------------------------------------------------------------------------------------- - -# Object build options -# -mcpu=cortex-m4 SepcifiesTarget ARM processor. -# -mfpu=fpv4-sp-d16 Specifies floating-point hardware. -# -mfloat-abi=softfp Allows the generation of code using hardware floating-point instructions, but still uses the soft-float calling conventions. - -set(OBJECT_GEN_FLAGS "-mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp") - -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OBJECT_GEN_FLAGS}" CACHE INTERNAL "C Compiler options") -set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${OBJECT_GEN_FLAGS}" CACHE INTERNAL "C++ Compiler options") -set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} ${OBJECT_GEN_FLAGS}" CACHE INTERNAL "ASM Compiler options") - -# Linker flags -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -T${LINKER_SCRIPT}" CACHE INTERNAL "Linker options") diff --git a/examples/knx-cc1310/cmake/gdb-helper.cmake b/examples/knx-cc1310/cmake/gdb-helper.cmake deleted file mode 100644 index 384e2d2..0000000 --- a/examples/knx-cc1310/cmake/gdb-helper.cmake +++ /dev/null @@ -1,40 +0,0 @@ -## -## Author: Johannes Bruder -## License: See LICENSE.TXT file included in the project -## -## Collection of functions to generate different GDB debugging configurations -## - -# Get the path of this module -set(CURRENT_MODULE_DIR ${CMAKE_CURRENT_LIST_DIR}) - -#--------------------------------------------------------------------------------------- -# Set tools -#--------------------------------------------------------------------------------------- -set(GDB_BIN ${TOOLCHAIN_BIN_DIR}/${TOOLCHAIN}-gdb${TOOLCHAIN_EXT}) -if(NOT OPENOCD_BIN) - if(CMAKE_HOST_SYSTEM_NAME STREQUAL Linux) - set(OPENOCD_BIN "/usr/bin/openocd" CACHE STRING "OpenOCD executable") - elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL Darwin) - set(OPENOCD_BIN "/usr/local/bin/openocd" CACHE STRING "OpenOCD executable") - elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows) - set(OPENOCD_BIN "C:/openocd/bin/openocd.exe" CACHE STRING "OpenOCD executable") - endif() -endif() - -#--------------------------------------------------------------------------------------- -# Generates a GDB run script for debugging with STLINKv1/v2/v2-1 programmer and texane stlink tool. -# More infos check: https://github.com/texane/stlink -#--------------------------------------------------------------------------------------- -function(generate_run_gdb_stlink TARGET) - get_target_property( TARGET_NAME ${TARGET} NAME ) - configure_file(${CURRENT_MODULE_DIR}/stlink-run.gdb.in ${PROJECT_BINARY_DIR}/stlink-run.gdb @ONLY) -endfunction() - -#--------------------------------------------------------------------------------------- -# Generates a GDB run script for debugging with any supported programmer and openOCD. -#--------------------------------------------------------------------------------------- -function(generate_run_gdb_openocd TARGET) - get_target_property( TARGET_NAME ${TARGET} NAME ) - configure_file(${CURRENT_MODULE_DIR}/openocd-run.gdb.in ${PROJECT_BINARY_DIR}/openocd-run.gdb @ONLY) -endfunction() diff --git a/examples/knx-cc1310/cmake/openocd-run.gdb.in b/examples/knx-cc1310/cmake/openocd-run.gdb.in deleted file mode 100644 index e3b7f56..0000000 --- a/examples/knx-cc1310/cmake/openocd-run.gdb.in +++ /dev/null @@ -1,5 +0,0 @@ -file @TARGET_NAME@ -target extended-remote localhost:3333 -monitor reset halt -load -thbreak main diff --git a/examples/knx-cc1310/cmake/stlink-run.gdb.in b/examples/knx-cc1310/cmake/stlink-run.gdb.in deleted file mode 100644 index fee6062..0000000 --- a/examples/knx-cc1310/cmake/stlink-run.gdb.in +++ /dev/null @@ -1,6 +0,0 @@ -file @TARGET_NAME@ -target extended localhost:4242 -monitor reset halt -shell sleep 1 -load -thbreak main diff --git a/examples/knx-cc1310/vscode/launch.json.example b/examples/knx-cc1310/vscode/launch.json.example new file mode 100644 index 0000000..aa5a3a0 --- /dev/null +++ b/examples/knx-cc1310/vscode/launch.json.example @@ -0,0 +1,20 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Cortex Debug", + "cwd": "${workspaceRoot}", + "executable": "./build/knx-cc1310", + "request": "launch", + "type": "cortex-debug", + "servertype": "jlink", + "serverpath": "/opt/SEGGER/JLink/JLinkGDBServerCLExe", + "device": "CC1310F128", + "interface": "jtag", + "runToMain": false, + } + ] +}