When starting a new project, in many cases it is helpful to start from an existing project and copy it. Here are some methods to do this when starting with the Kinetis Software Development Kit (KSDK). This example is done with KSDK v1.3.0, and the toolchain Kinetis Design Studio (KDS) v3.2.0, using the KSDK hello_world demo for the FRDM-KL03Z board. There is a handy tool called KSDK Project Generator, which is useful for starting a new KSDK project, or cloning some KSDK example projects. But sometimes it is still preferred to copy an existing project. KDS is built on the Eclipse IDE. And Eclipse provides the ability to copy a project within the Project Explorer view. To do this, right-click the project in the Projects View to copy, and select Copy. And then the project can be pasted in the Project Explorer. When pasting the project, Eclipse defaults to creating the copied project in your workspace directory. Using the default location like this works for simpler projects, where the needed files are self-contained in the project directory. But with a KSDK example project, this default location will typically lead to errors in the copied project, see screenshot below. The reason is because the KSDK example projects use project-relative paths to find the source files and libraries used by the project. These paths are relative from the original KDS project directory. After copying to a new location like this, the needed files are no longer in the same relative location from the new KDS project directory. In a new location like this, all the paths in the project settings will need to be updated from the new location to build. So another option when copying the project is to place the new project under the same parent directory of the original project. That way, all the project-relative paths are the same. For example, the hello_world KDS project directory used here is located by default at C:\Freescale\KSDK_1.3.0\examples\frdmkl03z\demo_apps\hello_world\kds. This time, the new project will be copied to the same parent directory, using C:\Freescale\KSDK_1.3.0\examples\frdmkl03z\demo_apps\hello_world\Copied_hello_world_frdmkl03z. Using this location, the copied project builds without errors. If it is preferred to move the new project somewhere other than the parent directory of the original project, then the paths in the new project settings need to be updated. Here are the typical project settings within KDS that need to be changed based on the new project directory location: C Compiler Includes settings for all the header files in KSDK: Linker settings for the linker command file location: Linker settings for KSDK library locations:
View full article