using KDS 3.2.0
SDK_2.1_MK22FN512xxx12 (SDK version: KSDK 2.1.0, OS: os-windows, Toolchain: KDS,
Selected optional items: CMSIS DSP Library, USB stack)
Win 7
KFRDM-K22F board
I recently downloaded the KSDK 2.1 for the MK22FN512xxx12 device. I am attempting to load the example USB projects into KDS. Specifically, I am interested in the Bare Metal (Lite and non-Lite) version of the Generic HID USB device examples located in: SDK_2.1_MK22FN512xxx12\boards\frdmk22f\usb_examples\usb_device_hid_generic\bm and ..\usb_device_hid_generic_lite\bm.
After importing the project into a new workspace (File->Import->General->Existing Project into Workspace, root directory C:\Freescale\SDK_2.1_MK22FN512xxx12\boards\frdmk22f\usb_examples\usb_device_hid_generic_lite, "copy projects into workspace" checked), I am:
a.) unable to locate main.c
b.) unable to build the project (I receive multiple errors, listed below:)
Here are my questions:
1.) What obvious thing am I doing incorrectly?
2.) Where is main located for the examples. I cannot locate a main.c file
Attempted debug build error and warning listing:
make: *** No rule to make target 'C:/devices/MK22F51212/drivers/fsl_clock.c', needed by 'drivers/fsl_clock.o'. dev_hid_generic_lite_bm_frdmk22f C/C++ Problem
make: *** No rule to make target 'C:/devices/MK22F51212/drivers/fsl_common.c', needed by 'drivers/fsl_common.o'. dev_hid_generic_lite_bm_frdmk22f C/C++ Problem
make: *** No rule to make target 'C:/devices/MK22F51212/drivers/fsl_flash.c', needed by 'drivers/fsl_flash.o'. dev_hid_generic_lite_bm_frdmk22f C/C++ Problem
make: *** No rule to make target 'C:/devices/MK22F51212/drivers/fsl_gpio.c', needed by 'drivers/fsl_gpio.o'. dev_hid_generic_lite_bm_frdmk22f C/C++ Problem
make: *** No rule to make target 'C:/devices/MK22F51212/drivers/fsl_lpuart.c', needed by 'drivers/fsl_lpuart.o'. dev_hid_generic_lite_bm_frdmk22f C/C++ Problem
make: *** No rule to make target 'C:/devices/MK22F51212/drivers/fsl_sim.c', needed by 'drivers/fsl_sim.o'. dev_hid_generic_lite_bm_frdmk22f C/C++ Problem
make: *** No rule to make target 'C:/devices/MK22F51212/drivers/fsl_smc.c', needed by 'drivers/fsl_smc.o'. dev_hid_generic_lite_bm_frdmk22f C/C++ Problem
make: *** No rule to make target 'C:/devices/MK22F51212/drivers/fsl_uart.c', needed by 'drivers/fsl_uart.o'. dev_hid_generic_lite_bm_frdmk22f C/C++ Problem
make: *** No rule to make target 'C:/devices/MK22F51212/gcc/startup_MK22F51212.S', needed by 'startup/startup_MK22F51212.o'. dev_hid_generic_lite_bm_frdmk22f C/C++ Problem
make: *** No rule to make target 'C:/devices/MK22F51212/system_MK22F51212.c', needed by 'startup/system_MK22F51212.o'. dev_hid_generic_lite_bm_frdmk22f C/C++ Problem
make: *** No rule to make target 'C:/devices/MK22F51212/utilities/fsl_debug_console.c', needed by 'utilities/fsl_debug_console.o'. dev_hid_generic_lite_bm_frdmk22f C/C++ Problem
make: *** No rule to make target 'C:/middleware/usb_1.4.0/device/usb_device_dci.c', needed by 'usb/device/source/usb_device_dci.o'. dev_hid_generic_lite_bm_frdmk22f C/C++ Problem
make: *** No rule to make target 'C:/middleware/usb_1.4.0/device/usb_device_khci.c', needed by 'usb/device/source/khci/usb_device_khci.o'. dev_hid_generic_lite_bm_frdmk22f C/C++ Problem
make: *** No rule to make target 'C:/middleware/usb_1.4.0/osa/usb_osa_bm.c', needed by 'osa/usb_osa_bm.o'. dev_hid_generic_lite_bm_frdmk22f C/C++ Problem
make: *** No rule to make target 'C:/Users/keesec1/LocalDocuments/KinetisWorkspaces/KSD_2_1_USB_Example/board.c', needed by 'board/board.o'. dev_hid_generic_lite_bm_frdmk22f C/C++ Problem
make: *** No rule to make target 'C:/Users/keesec1/LocalDocuments/KinetisWorkspaces/KSD_2_1_USB_Example/clock_config.c', needed by 'board/clock_config.o'. dev_hid_generic_lite_bm_frdmk22f C/C++ Problem
make: *** No rule to make target 'C:/Users/keesec1/LocalDocuments/KinetisWorkspaces/KSD_2_1_USB_Example/hid_generic.c', needed by 'sources/hid_generic.o'. dev_hid_generic_lite_bm_frdmk22f C/C++ Problem
make: *** No rule to make target 'C:/Users/keesec1/LocalDocuments/KinetisWorkspaces/KSD_2_1_USB_Example/pin_mux.c', needed by 'board/pin_mux.o'. dev_hid_generic_lite_bm_frdmk22f C/C++ Problem
make: *** No rule to make target 'C:/Users/keesec1/LocalDocuments/KinetisWorkspaces/KSD_2_1_USB_Example/usb_device_ch9.c', needed by 'sources/usb_device_ch9.o'. dev_hid_generic_lite_bm_frdmk22f C/C++ Problem
make: *** No rule to make target 'C:/Users/keesec1/LocalDocuments/KinetisWorkspaces/KSD_2_1_USB_Example/usb_device_descriptor.c', needed by 'sources/usb_device_descriptor.o'. dev_hid_generic_lite_bm_frdmk22f C/C++ Problem
make: *** No rule to make target 'C:/Users/keesec1/LocalDocuments/KinetisWorkspaces/KSD_2_1_USB_Example/usb_device_hid.c', needed by 'sources/usb_device_hid.o'. dev_hid_generic_lite_bm_frdmk22f C/C++ Problem
make: Target 'all' not remade because of errors. dev_hid_generic_lite_bm_frdmk22f C/C++ Problem
and warnings
Invalid project path: Include path not found (C:\CMSIS\Include). dev_hid_generic_lite_bm_frdmk22f pathentry Path Entry Problem
Invalid project path: Include path not found (C:\devices\MK22F51212). dev_hid_generic_lite_bm_frdmk22f pathentry Path Entry Problem
Invalid project path: Include path not found (C:\devices\MK22F51212\drivers). dev_hid_generic_lite_bm_frdmk22f pathentry Path Entry Problem
Invalid project path: Include path not found (C:\devices\MK22F51212\utilities). dev_hid_generic_lite_bm_frdmk22f pathentry Path Entry Problem
Invalid project path: Include path not found (C:\middleware\usb_1.4.0). dev_hid_generic_lite_bm_frdmk22f pathentry Path Entry Problem
Invalid project path: Include path not found (C:\middleware\usb_1.4.0\device). dev_hid_generic_lite_bm_frdmk22f pathentry Path Entry Problem
Invalid project path: Include path not found (C:\middleware\usb_1.4.0\include). dev_hid_generic_lite_bm_frdmk22f pathentry Path Entry Problem
Invalid project path: Include path not found (C:\middleware\usb_1.4.0\osa). dev_hid_generic_lite_bm_frdmk22f pathentry Path Entry Problem
Thanks for any help.
so just in case someone else runs into this problem here is what I have discovered:
1.) I cannot tell what is wrong with what I did in my original post. As far as I know, it should work.
*However, I was able to get the project to compile after I did the following:
a.) download and open the KSDK project generator application (Software Development Kit for Kinetis MCUs|NXP)
b.) click the "Advanced" button on the bottom left
c.) select "Clone' under the project type (I dont know what "new" does)
d.) select the desired source example project from dropdown menu
e.) check "Generate standalone project" box (not sure what this does, there isn't good documentation on the tool)
f.) select a "Project Parent Directory" (again, not entirely clear on what this does / what it is for)
g.) click "Advanced Generate!"
h.) open a clean KDS workspace and import the project into the workspace. you should now be able to build the project.
* note: I noticed an excess of empty folders in the cloned project. I deleted them, but I don't know why they were there
2.) main() is in hid_generic.c
notes to any Freescale / NXP / Qualcomm engineers:
1.) please keep the main() function in main.c so we can find it
2.) the documentation on the KSDK project generator is very sparse. Why do I need it? Why wasn't I able to import the project normally?
3.) Where is the documentation on how the USB stack works? All of the reference guides I have found indicate that if you want to build a USB application, you have to start with an example.
Hi Chris Keeser
Problem in your original post is
After importing the project into a new workspace (File->Import->General->Existing Project into Workspace, root directory C:\Freescale\SDK_2.1_MK22FN512xxx12\boards\frdmk22f\usb_examples\usb_device_hid_generic_lite, "copy projects into workspace" checked)
KSDK 2.1 examples uses linked files that has relative paths. This paths are relative to the location of the project, and when you copy a project into your workspace, this paths will not work if your workspace isn't located in the same path that the original example:
This is why we recommend to uncheck this option when working with examples, and when the customer want to develop his own example, use project generation tool to clone a project or add libraries needed in the proprieties. About USB documentation, you can fins some manuals in the path <SDK_2.1_MK22FN_path> \docs\usb.
Hope this information helps you
Have a great day,
Jorge Alcala
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Chris,
it is also possble to clone SDK 2.1 examples using KDS "New Project Wizard".
All the source files for the example will be copied into workspace.
Regards
Marek
Note: this feature is supported with SDK 2.1 and NPW 2.0.1
Thank you Marek. I updated the New Project Wizard (NPW) and used that to clone the project. This is highly preferable over using the stand alone tool.