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:
Hi Derek - Obviously you know that cloning an example is something every developer will need to do multiple times.
So, obviously we need a way to do this WITHOUT:
Please, tell us there is a better way?
This wastes a colossal amount of your customer's time!
Thanks in advance,
Best Regards, Dave
Hi Dave,
Have you tried using the Kinetis SDK Project Generator (http://www.nxp.com/ksdk has it listed on the web page for download) that Derek points out?
It is now on revision 2.3.
The installation has a KSKD Project Generator Release Notes.pdf .
Derek's Document is just showing a manual approach that I think all agree can be tedious but for some people useful.
Regards,
David
Thanks David - I downloaded the latest KSDK. While I'm glad to see the last KSDK bug I reported is fixed,
the "Project Parent Directory" is grayed out and cannot be set - so I cannot clone my project:
Only the demo_apps can be cloned with KSDKl.
It would be great if Freescale/NXP could fix:
Other vendors we are evaluating certainly do these things!
Thanks,
Best Regards, Dave
Hi Dave,
I agree.
I'll pass this feedback to the KSDK-Project-Generator team.
Regards,
David
Thanks David, but it would be best if there was no separate "Project Generator" utility. Don't make customers search for this stuff; integrate it into Eclipse (as do your competitors). Don't build stand-alone utlities with goofy interfaces that must be built and maintained for separate development platforms; integrate the facilities into Eclipse (as do your competitors). And the examples really need to properly use relative references for all sources and include paths!
Thanks again,
Best Regards, Dave
Hi Dave,
you can try latest version of KDS New Project Wizard for SDK2.x - this version already supports cloning of the example projects for the SDK 2.0 packages updated recently. This feature needs some data in the SDK package, so it does not work for all yet, but you can try for example FRDM-K82F or MKV58. The other devices will be supported in next SDK package update.
Note: the same functionality is in the SDK Project Generator v2.3
Regards
Marek Trmac