Git Product home page Git Product logo

tm4c-cmake-template's Introduction

TM4C CMake Project

Simple template for a TM4C project compiled with CMake. The goal is to use this with VSCode and the Cortex-Debug extension to avoid Keil. This should also work with CLion.

Getting Started

Linux Dependencies:

sudo apt install gcc-arm-none-eabi gdb-multiarch binutils-multiarch cmake
sudo apt install openocd
sudo apt install lm4flash

lm4flash is optional -- the flash script is configured to flash with OpenOCD for Windows compatibility.

Windows Dependencies:

Install the following dependencies:

  • CMake
    • Make sure to select add to path in the installer (either user or system path will work)
  • Ninja (or make)
    • Download latest ninja-win.zip from the official Github
    • Copy ninja.exe to C:\Program Files\CMake\bin\ (Or elsewhere in your path)
  • GNU Arm Embedded Toolchain (get latest gcc-arm-none-eabi-*-win32.exe)
    • Make sure to select "Add path to environment variable" at the last step
  • OpenOCD
    • Download Windows release from Github.
      • v0.11.0 and v0.12.0 worked for me. Earlier versions did not work, future versions probably should work.
    • Extract the contents of openocd-v0.12.0-i686-w64-mingw32.tar.gz to C:\openocd-v0.12.0 (7-Zip can be used to extract .tar.gz archives on Windows)
    • Add C:\openocd-v0.12.0\bin to your path.
  • Visual Studio Code

Set up Visual Studio Code:

Install vscode from Microsoft

Install these extensions:

  • C/C++
  • CMake
  • CMake Tools
  • Cortex-Debug

When you first open this project in VSCode, you will need to set the "CMake Kit" to TM4C Toolchain to select the installed arm-gcc compiler and set the CMake Generator to Ninja. You will also need to set the build variant (Debug) and build target (Test.elf). Once this has been done, you should be able run CMake: Configure and CMake: Build (ctrl-shift-P to open command palette). The shortcut ctrl-shift-B can be used to run the default build task (set in .vscode/tasks.json).

Command Line Development

This project will work without VSCode if you want to use another text editor. To compile and flash from the command line:

mkdir build
cd build
cmake ..
make Test.elf
make flash

Or on Windows:

mkdir build
cd build
cmake -G "Ninja" ..
ninja Test.elf
ninja flash

Resources

tm4c-cmake-template's People

Contributors

benmarsan avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.