CodeWarrior 10.6, KSDK, and PE

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CodeWarrior 10.6, KSDK, and PE

682 Views
scottm
Senior Contributor II

I'm new to Kinetis and still scratching my head over the relationship between all of the tools.  After years on CodeWarrior 6.3, I moved to 10.6 to be able to use a modern OS and to have a single development environment for my existing HCS08 and Coldfire projects as well as my new Kinetis projects.  It's starting to look like using CW for Kinetis might have been a bad choice, with Freescale in the process of abandoning it, but seeing as I've already sunk the money into a license I figure I'll try to stick it out for a bit.

 

I'm trying to get started with a USB MSD implementation on a K22F as a replacement for a Coldfire v1 MCU running a Freescale-provided USB stack.  It looks like the Kinetis SDK is where I would find the equivalent stack, and indeed there's a demo app, but it looks like the KSDK is not set up to work with CodeWarrior.

 

I would jump in and start trying to build what I need, but I thought I ought to check if this was a solved problem already.  Also, I'm not clear on the relationship of KSDK to Processor Expert.  I'm finally getting used to PE and I would rather not break it.

 

tl;dr:Need a USB stack for Kinetis K22 series.  Where do I get it, and how do I get it into CW 10.6 without breaking PE?

 

Thanks,

 

Scott

Labels (1)
0 Kudos
2 Replies

405 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hello

professor Erich Styger wrote a good article on how to use USB with the Freescale FRDM-K22F Board with processor expert component, can you refer it?

USB with the Freescale FRDM-K22F Board | MCU on Eclipse

you will more related articles' link on the bottom of this page.

hope this helps!


Have a great day,
Zhang Jun

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

405 Views
scottm
Senior Contributor II

I did see that.  I managed to get there on my own through a different route, and I should share some of my answers here in case it's of use to anyone else.

The Freescale USB Stack v4.1.1 turned out to be what I needed.  It's listed as archived and you have to click "more" to find it because it's hidden and only older releases are shown.  It includes Processor Expert components and there's a quick start guide included, but no K22 examples are provided.  Version 5.0 is available but doesn't have Processor Expert support.  Newer versions have been moved into KSDK and no CodeWarrior examples are provided.

My next problem was that the MK22FN1M0VLH12 I was using is NOT completely compatible with the MK22FN512VLH12.  They differ significantly more than just memory size, and the FRDM board wasn't of any use.  I eventually discovered that CW 10.6 includes in its example Kinetis PE projects an MSD example for the TWR-K21F120MA that will run on the K22FN1M0.

What really cost me a lot of debugging time was the MPU.  It was set to 'disabled' in PE, but I didn't notice that the configuration itself was disabled, so the MPU was starting up in its default state and denying DMA access to the USB controller.  This means that everything up through the first SETUP transaction worked fine, including SOF packet reception.  It couldn't access the BDT, though, and presumably couldn't see that endpoint 0 was configured and ready for a SETUP packet.

So... the stack works fine, PE is fine, CW is fine, just pay attention to the MPU settings and don't trust that the USB component is going to warn you about a problem.

Since I didn't have a working board to start with I spent way more hours than I'd have liked troubleshooting every layer.  I did get to break out the USB protocol analyzer I've only ever used once before, and now I can read USB packets straight off an oscilloscope, so I guess that's something.

Thanks for the answer.  I was starting to wonder if this forum was still alive.

Scott

0 Kudos