Skip to content

Hercules (TMS570LS122) Template Project (CMakefile/Ninja)

License

Notifications You must be signed in to change notification settings

josepablo134/TMS570CTemplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TMS570CTemplate

A template for projects based on the TMS570 microcontroller (Launchpad XL2, TMS570LS1224).

Toolchain

ARM NONE EABI GCC

You can install it from here.

Warning

TMS570 is a big-endian part (BE32), GCC libraries are compiled only for little-endian systems. Recompile the gcc libs is required.

TMS570 GCC LIBC Big Endian

TI TMS570 GCC LIBC Big Endian

ARM Toolchain

ARM Toolchain Source Code

ARM newlib Source Code Git Repo: https://sourceware.org/git/newlib-cygwin.git

TI ARM CGT (Code Generation Tools)

You can install it from here.

This tool has the big endian libs so no workaround is needed with this option.

Project structure

  • project/cmake : Contains the toolchain (compiler, linker and options definition), the linker script and some project specific cmake variables.

  • project/BSP/HALCoGen : Software component containing the basic software package, this package is generated from HALGCode Tool, here there are multiple examples of projects that can be imported into HALCoGen to reconfigure and generate a new BSP.

CMake and Ninja

CMake is a tool for generation and automation of code. The name is an abbreviation of cross platform make. It is a multiplatform, open-source tool that can generate Makefiles (or different build system projects like Ninja) from a simple and more readable configuration file. CMake in a nutshell is a syntax to describe a project and the compiler environment so it can be abstracted from the final build system file (Makefiles, Ninja.build, Eclipse .cproject, etc)

Ninja, in other hand, is a build system tool meant to replace Makefiles. It is focused by design to run as fast as possible. It already knows the number of cores of your machine, so it dynamically decides when and how to parallelize the build process.

Build Process

The build process is pretty straightforward, just create a build folder, invoke CMake over the project folder and then run ninja (I recommend to use Ninja instead of Make).

$ #Assuming you are at the root folder of this repo:
$ mkdir build
$ cd build
$ cmake ../project -GNinja
$ ninja

After the compilation, the artifacts are located at the new build/bin folder. This will generate ELF, S19 and HEX files. You can now load the binary to the microcontroller using OpenOCD and see the leds blinking.

Important!

If you have any comment or question, you can reach me out josepablo134@gmail.com

Releases

No releases published

Packages

No packages published

Languages