This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS570LS3137: Cmake Example

Part Number: TMS570LS3137

Tool/software:

Hello everyone,

I'm working on a project with the TMS570LS3137 microcontroller and would like to set up a build process using CMake, without relying on Code Composer Studio (CCS). I have a few questions regarding how to configure everything correctly:

  1. How do I set up CMake for cross-compiling for the TMS570LS3137?
  2. What are the key files and configurations I need, such as the toolchain file and linker script?
  3. Are there any specific flags or settings I need to be aware of when using CMake for this platform?

Any help or advice would be greatly appreciated!

Thanks in advance!

  • cmake_minimum_required(VERSION 3.10)

    project(vcu_kar LANGUAGES C ASM)

    set(CMAKE_C_COMPILER "/home/karluna/ti-cgt-arm_20.2.7.LTS/bin")

    set(CPU_FLAGS "--cpu=cortex-r4 --fpu=none")
    set(COMMON_FLAGS "${CPU_FLAGS} -O2 -g")

    set(CMAKE_C_FLAGS "${COMMON_FLAGS}")
    set(CMAKE_ASM_FLAGS "${COMMON_FLAGS}")
    set(CMAKE_EXE_LINKER_FLAGS "--scatter=linker_script.scat --info=totals,unused")

    set(SOURCES
        /home/vcu-kar/vcu-kar/karluna/
    )

    add_executable(vcu-kar ${SOURCES})

    target_link_options(vcu-kar PRIVATE "${CMAKE_EXE_LINKER_FLAGS}")


    This is my cmake file for now.

    Here is my file structure:

    My lib is submodule.

  • Unfortunately, TI has no application notes, or anything similar, which describe how to use CMake with the TI Arm compiler (short name armcl).  If it is practical for you to change to the TI Clang Arm compiler (short name tiarmclang), then you can start with this example from the online manual.

    Thanks and regards,

    -George