Freedom board + CodeWarrior10.3 = no working USB projects?

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

Freedom board + CodeWarrior10.3 = no working USB projects?

Jump to solution
1,689 Views
Frost
Contributor II

I spent several frustrating hours last night, nearly getting USB projects to work on the freedom platform. To be clear, I've got OpenSDA working, latest drivers, latest codewarrior (special edition) and done some basic GPIO / timer / interrupt work with the board.

Bear in mind I'm trying only to get a **CDC Device** project working, nothing more.

So, I tried:

1. importing baremetal code (file by file) and re-writing to work around a clean PE project - compiled with errors pointing to a a file on a drive that doesn't exist on my machine, so I couldn't find / resolve these. No luck.

2. Processor expert USB project, using USB Stack and docs as a guide. Followed the CDC implementation, except for Freedom board, not K60 as was in the guide. Main system clk was set 96MHz PEE config, 48MHz sys clk and 24MHz IPBUS / peripheral, all working ok. Go through the CDC steps and it then says the OTGEN bit is set, and won't generate PE code. No way to change this, as PE wont let me change code it hasn't generated yet, and I change the register setting in basic / advanced / expert with or without the graphic box enabled.

3. My memory is hazy here, forgive me, but I imported a USB stack example CDC project and tried compiling that. I got errors here also.

Has anyone managed to get a plain CDC device implementation working on their freedom board? As I said, I've played around with the basics, debugging and basic operation is ok. Do I have to resort to Keil? At least their examples seemed to work. Anyone got any suggestions here?...

Labels (1)
1 Solution
886 Views
BlackNight
NXP Employee
NXP Employee

Hello,

I *do* have USB CDC working for the Freedom Board.

See Tutorial: USB CDC with the KL25Z Freedom Board | MCU on Eclipse

But the USB clock depends on if your board has that R25 populated or not:

Using the 8 MHz Crystal on the FRDM-KL25Z Freedom Board | MCU on Eclipse

Let me know if you have that R25 on the board or not, then I post you here a project/S19 file you could try with your board.

Erich

View solution in original post

8 Replies
886 Views
steve_fae
Senior Contributor I

Tau, I am on the verge of getting a CDC project to work with a ton of Erich's help.  What my CDC project needs to accomplish is using Hyperterminal, when a carriage return is hit then logged data within the microcontroller is passed back.  If that is something similar to what you need, give me a couple of days to get the final bugs fixed and once I strip out customer specific code I will share the project with you. 

886 Views
Frost
Contributor II

Thanks for the offer Steven, I'm going through some USB pain again at the moment as I want to port this code to a GCC + eclipse toolchain of my own devising - no code limits etc but it's own bag of problems.

Anyway, this was just a test, for my own personal projects so there isn't any personal end goal; Might be some useful info here: waiting for friday if you're interested in the windows driver side though. Essentially, what I want is:

1. Basic working CDC or HID example, where I can communicate with the embedded device.

2. Windows driver / communication app to get data.

I've done this before with PIC32MX, WLAN + C# / Java network listener. The pain I'm having at the moment is a win7 x64 compatible inf file. I'm wondering if this here might be a clue. I've looked here also, but alas, no 64bit compatible inf file.

Extremely annoying as I can't install the processor expert demo in the 403 stack and see if it works. :smileysad:

0 Kudos
886 Views
steve_fae
Senior Contributor I

I am running windows 7 32 bit so the INF file that Erich provides with his CDC project works great.  The only mystery I find is if I power the FRDM board with USB, and then provide 3.3V to the coin cell connection with an external power supply, the glide point mouse on my PC starts to drag.  I am guessing they didn't isolate their design very well and some voltage is somehow effecting my USB port.

0 Kudos
887 Views
BlackNight
NXP Employee
NXP Employee

Hello,

I *do* have USB CDC working for the Freedom Board.

See Tutorial: USB CDC with the KL25Z Freedom Board | MCU on Eclipse

But the USB clock depends on if your board has that R25 populated or not:

Using the 8 MHz Crystal on the FRDM-KL25Z Freedom Board | MCU on Eclipse

Let me know if you have that R25 on the board or not, then I post you here a project/S19 file you could try with your board.

Erich

886 Views
gmscribe
Contributor II

Hi Eric,

Did you ever get USB HID working on the Freedom? I'm having a little trouble with the USB Stack/PE/Keil combination. My device refuses to enumerate, however I'm as a close to example code as possible.

0 Kudos
886 Views
BlackNight
NXP Employee
NXP Employee

I started to work on the HID class, but I have not finished it yet.

0 Kudos
885 Views
Frost
Contributor II

Thanks Erich - it's frustrating when you're almost there but can't change one little thing...

So, just for your info, my board doesn't have R25 (normal I think) and PE sets the osc to low power by default. I'd had this bit working anyway and could get the 48MHz the USB needed.

I also needed to install the Wait component, and the ring buffer. As I'd started the project without the ring buffer, I had to refresh the components in PE once I'd imported, and then close the project (saving changes) and then re-open. Once re-opened, the ring buffers were there as indexed.

Created code, wrote your demo cdc_run into main, and it's working like a champ.

This might be cheeky, but is there anything obvious I can do to cut down on the code size?...

And thanks also for replying quickly, I saw the reply when I got to work, and was waiting all day to try this!!! :smileygrin:

Thanks :smileyhappy:

0 Kudos
885 Views
BlackNight
NXP Employee
NXP Employee

Hi Tau,

good to hear that things are working on your end.

Hope this helps,

Erich

0 Kudos