I have a bare-metal(and by bare-metal I mean that I have written absolutely everything from scratch, apart from the relevant header files) KL26Z project under KDS 3.1, and I have reached a point where I would like to add USB CDC capability to it. Although KDS shows the "Processor Expert" tab at the top of the window, I don't really know how to go about this. Is it even possible to add a Processsor Expert component to a bare-metal project, or do I have to start from scratch and add all the code I've written so far to a new project? Where do I find all the Processor Expert components, and how do I make KDS aware of them?
Hi John,
First: make a backup of your project.
Then you can use the 'Enable Processor Expert for Existing project' wizard, see section "Adding Processor Expert to the Project" in https://mcuoneclipse.com/2014/01/19/diy-free-toolchain-for-kinetis-part-8-processor-expert-eclipse-a...
After that step, go though the project settings and assign the correct processor/compiler options/include settings as outlined in above article.
I hope this helps,
Erich
Thanks, Erich. I've done the "Adding Processor Expert to the Project", but still no joy. If I trie to add the FSL_USB_STACK and/or the CDC component, I just get a river of error messages. Do you know if KL26Z is supported?
Hi John,
yes, the KL26Z is supported for Processor Expert projects and components. So not sure what error messages you see?
Erich
Description Resource Path Location Type
Error in the inherited component settings (CDCDevice) cdc USB1/CDCDevice Processor Expert Problem
Error in the inherited component settings (USB Init) cdc USB1/USB Init Processor Expert Problem
ERROR: Peripheral Initialization component is not supported for selected target processor cdc USB0 Processor Expert Problem
Generator: ERROR: There are errors in the project, please review components configuration. It is not possible to generate code. cdc Code Generator Processor Expert Problem
No type specified (Clock gate) cdc USB0/Clock gate Processor Expert Problem
No type specified (Module clock source) cdc USB0/Module clock source Processor Expert Problem
No value selected (CPU) cdc CDC2/CPU Processor Expert Problem
The component is not supported for selected processor (Component name) cdc USB0/Component name Processor Expert Problem
That sort of thing...
Hi John,
from the error messages, you have not configured the component for your device? Have a look (if not already?) at https://mcuoneclipse.com/2013/04/27/usb-cdc-with-the-frdm-k20d50m/
I hope this helps,
Erich
So I tried to install the Microcontrollers driver suite, but this is what I get.
I am reluctant to Update my installation, as I am worried I might lose my existing work.
Also, I feel like I'm hopelessly lost. Is Processor Expert supposed to generate real source code, that I can read and edit?
If there was any way I could find a working example of CDC code for the MKL26, I would probably not even be attempting this, but when I try to examine NXP examples, the code seems to be spread over a thousand different source files,some of which I simply can't find!
Hi John,
not sure why you think you have to install the driver suite? This is really not necessary, as KDS comes with all the needed support.
And yes, Processor Expert creates all readable code for you. It is getting late at night for me, and I don't have a KL26Z board with me. But I'll see if I can build quickly a USB CDC project for you by tomorrow.
I have such examples for CodeWarrior here:
mcuoneclipse/Examples/CodeWarrior/FRDM-KL26Z at master · ErichStyger/mcuoneclipse · GitHub
I simply would need to port the USB CDC example to KDS and put it here:
mcuoneclipse/Examples/KDS/FRDM-KL26Z at master · ErichStyger/mcuoneclipse · GitHub
Until then, I have attached for you the code of the CodeWarrior project. Maybe this helps or this is what you are looking for?
Erich
I guess I have a mistaken understanding about something, but I can't see any USB code in those two Github links. Which means, I suppose, that the USB stuff resides somewhere else, so I must be missing some component of KDS, or I have ommitted some steps. The reason I was trying to install the Driver Suite was because I was following the instructions from one of your blogs you linked to.
Is it that I need to somehow install KSDK version something or other? I thought I had KSDK 1.3 installed, but I really don't know what I'm doing here.
Maybe I should just re-install KDS from scratch? When I started this project, NXP were touting some sort of project builder( I forget the name now) but it didn't support the KL26 at the time. So I just started writing the code from the ground up.
Hi John,
You need to install the driver suite if you are using a stock Eclipse and not CodeWarrior or Kinetis Design Studio (which both have Processor Expert included).
You can use the Kinetis SDK, but then it is probably best if you do not use Processor Expert (see https://mcuoneclipse.com/2015/10/18/overview-processor-expert/ for an overview) as the latest SDK V2 does not support it any more.
You definitely should check out the SDK for the KL26Z from Welcome to Kinetis Expert | Kinetis Expert as it supports the KL26Z and comes with a USB stack and examples.
As for the USB code in the examples above: as the USB code is generated, it is not on GitHub (version control system should not contain derived files). Have you had a look at the example zip file I have posted above for CodeWarrrior? The USB stack files are in the Generated_Code folder.
I hope this helps,
Erich
Hi Erich, I confess I didn't see the zip attachment at the bottom of your post last night. Working through it now.
Many thanks,
John
Hi Erich,
I finally got it working. There were a few things I had to iron out, but I now have a working USB CDC. It's a lot of code, isn't it? I think I will have to tell my client that the 64K part option has disappeared.
I'm going to stop and have a beer now. Thanks again for all your help and support.
John