Base project setup for the board FRDM-KL05Z using Visual Studio Code and Cmake with the SDK 1.x
Report Bug
·
Request Feature
Table of Contents
Base project project setup for the board FRDM-KL05Z using CMake for Visual studio code with the SDK 1.x
- The project uses CMake for its build, so make sure you have it installed and working properly on your machine.
- This base project was built with linux machine in mind but can easily be converted to be used in a windows or macOS machine
-
Make sure to have all dependencies of the toolchain installed (Obs theses packages names are used to install with pacman tool for Arch linux, search for the equivalent for your Operational system)
- arm-none-eabi-newlib
- arm-none-eabi-gcc
- arm-none-eabi-binutils
- arm-none-eabi-gdb
- jlink
- doxygen (Optional)
-
Install all needed Visual Studio Code extensions
- ms-vscode.cpptools
- marus25.cortex-debug
- ms-vscode.cmake-tools
- twxs.cmake
- dan-c-underwood.arm
- zixuanwang.linkerscript
- cschlosser.doxdocgen (Optional)
-
Clone the repository.
git clone https://github.com/JoaoMario109/frdm-kl05z-quick-setup-sdk1.git
-
Configuring the project files and paths
- Configuring the arm-none-eabi-gcc.cmake file
- Search for the ARM_TOOLCHAIN_DIR variable and sets its value to be the path where the toolchain is installed in your machine
- Configuring the CMakeLists.txt file
- Search for the project() function and change the name (Eg: kl05z-sample-project -> my_project), description (Eg: kl05z-sample-project -> some nice description about my project) and the version (Eg: VERSION 1.0 -> Version 0.2)
- Configuring the documentation generation in the file docs/Doxyfile.in (Optional)
- Search for the properties PROJECT_NAME, PROJECT_NUMBER, PROJECT_BRIEF and change their values to match the values that you edited in your CMakeLists.txt
- Configuring the .vscode folder
- Edit the file c_cpp_properties.json and change the compilerPath property to match the location of your compiler
- Edit the file launch.json and change the property executable to match the path with the name of your executable file that you used in the CMakeLists.txt (Eg: ${workspaceRoot}/build/kl05z-sample-project.elf -> ${workspaceRoot}/build/my_project.elf)
- Edit the file launch.json and change the property serverpath to match you jlink server path location
- Edit the file launch.json and change the property armToolchainPath to match your arm toolchain path location
- Edit the file settings.json and change the property cortex-debug.armToolchainPath to match your arm toolchain path
- Configuring the arm-none-eabi-gcc.cmake file
When all configurations are ready, you first must select some kit to be used in the CMake extension and build the project, to make this follow the steps bellow
- Select a kit, search fot the button Select a kit in the left lower side of the vscode or use the command using the ctrl+shift+p / F1 and after prompting the command Cmake: Select a Kit, with all kits available select the GCC Arm Embedded
- Build the project using the Build button near the same location from the button on step 1 or use the command pallet ctrl+shift+p / F1 and prompting the command Cmake: Build
- Make sure to plug your board on your computer
- Now use the button in the left upper part of vscode run -> Start Debugging / F5
All contributions are welcome to the project.
When contributing to the project, make sure to ident your code using tabs with size 4, also make sure to take a better look in the conventions used in the code and try to follow it, this helps keep the code uniform, easy to understand.
Also remember the branch structures of the project
- master -> This branch only contains releases that are approved to deployment
- develop -> This branch only contains complete implemented and working features, all code submitted to these branch should compile without any compiler error.
- {developer-short-name}/{feature-description} -> Any code in development or feature improvement.
- Get the last develop and use as base for your branch
- Create your branch (
git checkout -b {developer-short-name}/{feature-description}
) - Make your changes to the code
- Add only needed changes to staged
- Commit your changes with good titled and description messages (
git commit
) - Push to the branch (
git push origin {developer-short-name}/{feature-description}
) - Open a PullRequest to develop
- Await reveal and approval to rebase and merge
Distributed under the MIT License. See LICENSE.txt
for more information.
João Mário Carnieletto Izoton Lago - Joao Mario
Project Link: https://github.com/JoaoMario109/frdm-kl05z-quick-setup-sdk1