This is a cross compiler CMake toolchain for the ARM GCC compiler for the ubirch hardware platform. The toolchain is pretty generic and based on the ARM mbed target.
- Check out the toolchain:
git clone git@github.com:ubirch/ubirch-arm-toolchain.git
- To use the toolchain, create a build directory outside of your source tree. Then either run
put the toolchain file into your main
CMakeLists.txt
(see example) or runcmake
with a reference to the toolchain file:
cd <build-dir>
cmake <source-dir> -DCMAKE_TOOLCHAIN_FILE=<toolchain-dir>/cmake/ubirch-arm-gcc-toolchain.cmake
- Finally, run
make
(ormake VERBOSE=1
) if you want to see everything).
bin
blhost
- directory containing the blhost executable for flashing via USB (Linux, Mac, Windows)
cmake
ubirch-arm-gcc-toolchain.cmake
- the toolchain filePlatform
Utils
require.cmake
- utility function to suportprovide()
/require()
mechanics (part of toolchain)flashing.cmake
- utility macroprepare_flash()
for simpler flashing (part of toolchain)flash.jlink.in
- template for flashing via SEGGER JLinkgdbinit
- init file for debugging with the GDB debuggergdbinit_flash
- init file for flashing via GDB debugger
CMakeLists.txt
- an example how to apply the toolchain file directlyexample
CMakeLists.txt
- an example for a compiling a simple programmain.c
- an example program (does nothing, not evenhello world
)
README.md
- this read me file.gitignore
- tells git what to ignore (i.e. C, C++, CLion, and CMake intermediate files).editorconfig
- editor configuration (only unix LF, 2 spaces indent)
The toolchain provides two functions for providing and requiring exported packages. This is useful for cross-compiled builds where we don't want to copy the libs into other projects, but rather require them. This is somewhat similar to maven build tools.
However, the provide
function exports directly from the build tree, which may break downstream builds if you make
changes. Should work well, in cases where support libraries are downloaded, built and simply used.
The provide
function also exports a special config for the CMAKE_BUILD_TYPE
, so downstream projects may request
a certain build type using require
.
To support easier flashing, a macro prepare_flash
is available which creates extra targets that
make flashing and debugging simpler.
In a kinetis-sdk.cmake
file we might export the KinetisSDK:
provide(PACKAGE KinetisSDK MCU MK82F25615 VERSION 2.0 TARGETS ksdk20 mmcau)
In a my-project.cmake
file we can then (if we use this toolchain!), require KinetisSDK:
require(PACKAGE KinetisSDK MCU MK82F25615 VERSION 2.0)
If not otherwise noted in the individual files, the code in this repository is
Copyright © 2016 ubirch GmbH, Author: Matthias L. Jugel
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.