I am posting the following in the hope that members of the community may have some ideas. The original idea was to replicate the MQX USB Host example into my own working area. This would allow me to change the files at will and experiment without having to worry about changing any of the original files. My first few attempts were futile attempts to do it the easy way and only lead to frustration and eventually to this post.
Since then, I have worked up the following procedure which seems to work - mostly. The procedure is to:
1. Follow the procedure at How To: Create a New MQX RTOS for KSDK Project in KDS and generate a new, clean, basic MQX project. For example, I put mine at C:\Projects\MQX-HelloWorld
2. Copy the entire folder to a new location and rename that subdirectory. For example, I named mine C:\Projects\MQX-USBHost.
3. Start KDS, and import the [project from the new directory. Note: Make sure there are no other projects in KDS. (Keep it simple and clean!)
4. In KDS, rename the project. Go to Project=>Properties=>C/C++ Build=>Settings : Build Artifact tab and rename the Artifactname. (Usually the same as the project. You can also use the ${ProjName} construct if you're comfortable with that.)
5. Delete the project from KDS and re-import. After doing the import, do a refresh. This may not be necessary, but it just makes sure that internal references are up to date.
6. Compile the project as a sanity check. It should be the same as the original project. If not, resolve any differences.
7. Open the original Freescale MQX example project as a second project. If you examine the modules and structure, you'll see that there are many commonalities - same debug console, etc.
8. Where there are differences, copy the files from the example into the new project. Be sure you copy the files and do not use links or virtual folders. (I used the Import from File system method.) If you are prompted to add include paths along the way, go ahead and accept them.
9. Be sure to replace the main.c of the original project with the appropriate module(s) from the example project. Again make sure it is an actual file copy into the final project.
11. At this point everything should be in place. Compile. I am sure that various header files will not be found. Go to the Project=>Properties=>C/C++ Build=>Settings=>Cross ARM C Compiler=>Includes and add the appropriate path to the "Include paths (-I)" section. This is an iterative process and may take many cycles to find all the files. I do NOT encourage just copying the include paths from the original example project as this tends to carry over a lot of "cruft". The current effort is to come up with a clean project that is more easily understood.
After all that, I got a clean compile and tried to debugit. It ran - partially. Just a portion of the initial message got printed and then it would hang. The symptom was almost identical to the problem I reported in _usb_khci_task_create() does not return. Which is also an attempt to use the USB host mode.
After a lot of stepping through the code, I thought that I must have copied something wrong, so I went through the entire project comparing the various files. All files were identical. This left the various project related files. In all cases except the two .cproject files, I could account for the differences. Although many of the differences are reasonably clear, there are a lot of little changes that make no sense.
So, here's where I'm looking for ideas. Is there some way to compare the two .cproject files to determine which differences are significant? They are XML files and a lot of the differences seem to be a numeric reference meaningful only to Ecplise, but which ones are safely ignored?
Any suggestions? I feel so close and yet so far!
Thanks