Hello internet stranger - if you are here, it is most likely you are here because you need help setting up CMake & Ninja project for your beefy Infineon TriCore TC3xx microcontroller. Well, you are in luck since I have done most of the hard work for you. Feel free to use this repo as a reference to help yourself get started in setting up your toolchain.
Note: You need to use the proper Tasking compiler that you purchased because using the AURIX Dev Studio compiler will not work. Yes, go ahead and try - it will detect that you are running from the commandline and refuse to build. It can probably be overcome, but I dont have the time or patientience to figure it out.
To run this project, the following must be installed and added to your PATH
environment variable:
- Just, a cross platform command runner
- CMake
- Ninja
- Powershell (installed and available on all Windows systems by default)
If you have Chocolatey installed, then run:
just install_deps
This will install the latest CMake on your system. You can Install chocolatey from here.
Before you build, if you change your project name in the CMakeLists.txt
file, you need to update the NinjaCmakeTaskingTriCoreProject.elf
in the justfile aswell! Otherwise, the post build scripts will fail. Editing a justfile is similar to a makefile, it should be straightforward.
Run the command:
just gen
Run the following from root dir:
just build
Building release only:
just buildr
Run the following from root dir:
just buildall
A full clean will delete bin
folder, Ninja files and all temporary Cmake related files.
just clean
Running for the first time, you might get powershell permission problems. Run just pwr_permissions
to gain proper security permissions. Then you can run everything like normal.
You can run just fmt
to run the clang formatter, but you need to add clang-format.exe
to your environment PATH, otherwise the powershell will complain.
You will see some build warnings regarding incompatible enum types for stuff inside the iLLD. I left this as is so that the project matches as close as possible to what AURIX Studio provides. Fixing these warnings should be trivial and is left as an exercise for the reader.