Freescale USB Stack v3.1.1 in K20

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

Freescale USB Stack v3.1.1 in K20

Jump to solution
2,614 Views
Kari
Contributor III

Hi all,

 

I have a custom board with PK20512VMD100. I am tryig to make a virtual com port using the Freescale USB stack and the CDC example. Can anyone give instructions what are the steps to succesfully make the stack port? I use IAR EW 6.3 and Freescale USB Stack v3.1.1 and J-link lite to debug.

 

The application works just fine in my K60 tower and the com port appers to my windows xp (after installing the windows driver), but when I try to run it on K20: it compiles and I can run the application in the debugger in both RAM or FLASH. In the hardware the D+ line pull-up happens to indicate full-speed device, but the enumeration does not work. Windows claims a maltfunctioned USB device (so it´s not entirely dead..)

 

Changes I have made to the example:

 

1. Included the header file for K20

2. Checked all platform dependent code and deleted all I can (e.g GPIO_Init(), still works in K60)

3. Checked the hardware a million times

 

I have not found a specific linker file for K20. I use the linker file for K60. Should I modify that?

 

Thanks,

Kari

0 Kudos
1 Solution
1,752 Views
dn031
Contributor I

Hi all,

for anyone else experiencing this, putting a capacitor on Vout (2.2uF) solved the problem as stated in the Reference manual USB regulator section, and this forum post: https://community.freescale.com/message/99758#99758

 

Cheers,

 

Dan

View solution in original post

0 Kudos
11 Replies
1,752 Views
PaoloRenzo
Contributor V

Have you tried this?

 

http://cache.freescale.com/files/32bit/software/KINETIS_50MHZ_SC.zip?fpsp=1

 

I think there's an example for CDC in there.

0 Kudos
1,752 Views
Dekiru
Contributor IV

Did you check clock setting (Init_Sys and pll_init function and defined values like BSP_CLOCK_SRC...)

 

Regards

0 Kudos
1,752 Views
Kari
Contributor III

Yes. I have the same clock option trhan in the K60 tower: An external 50MHz clock.

 

-Kari

0 Kudos
1,752 Views
Dekiru
Contributor IV

If you have K20 (100Mhz version) and use 50 Mhz oscillator so I don't see any problem with software...

The only other suggestion that I can think about is oscillator deviation and impedance of D+, D- lines

 

Regards

0 Kudos
1,752 Views
Kari
Contributor III

OK, thanks very much for your reply.

 

My D+ / D- lines are very short on the board and are routed as a pair on a solid ground layer (not quite sure about the impedance level, though).

 

Do you have any idea how much deviatio the clock is allowed to have? Is there a requirement for USB applications? I mean drift, jitter etc..

 

By the way, have you been able make K20 USB work?

 

Thanks,

Kari

0 Kudos
1,752 Views
Dekiru
Contributor IV

Unfortunately we haven't got any project with K20...

 

BTW, is your design using MAX3353 like TWR-SER? If not, you have to rewrite the routine for attach, detach... also.

 

Regards

 

0 Kudos
1,752 Views
Kari
Contributor III

This is interesting. I dont have MAX3353 on my K20 board and I thought that the CDC application is not using it...

 

Which part of the code is using the MAX3353? I mean where are those attach, detach routines you are referring to? This is absolutely worth checking out.

 

Thanks,

Kari

0 Kudos
1,752 Views
Dekiru
Contributor IV

Yes you are right, if you want to have CDC device only so the MAX one is not necessary.

That need for OTG only.

 

Sorry that I can not give you a solution.

 

Regards

0 Kudos
1,752 Views
dn031
Contributor I

Hi all,

 

I'm experiencing similar problems with a custom K20 board 100pin, 100Mhz part. Kari, did you ever find a solution to this issue?

 

I have tried code in a kwikstick k40 and and tower k60 which works perfectly, then modified it for the K20, clocks etc and it will not enumerate. Funnily enough it will enumerate perfectly when plugging in through an external USB hub. 

 

Same symptoms using code operating with MQX and baremetal USB. Is there likely to be a hardware fault in the USB module on the K20? No change observed when running the core at 24, 48 and 96Mhz whilst keeping the USB module at 48Mhz. 

 

Any response much appreciated.

 

Cheers,

Dan

0 Kudos
1,753 Views
dn031
Contributor I

Hi all,

for anyone else experiencing this, putting a capacitor on Vout (2.2uF) solved the problem as stated in the Reference manual USB regulator section, and this forum post: https://community.freescale.com/message/99758#99758

 

Cheers,

 

Dan

0 Kudos
1,752 Views
Kari
Contributor III

Hi Dan,

 

I had the 2.2uF allready..

 

In my board it was clearly a HW problem related to signal lines or grounding. It was solved by tweaking a mini usb connector to the board. Originally it was only usb cable leads directly soldered to the board. I dont know the root cause exactly but seems to have something to do with the layout and/or shileding/filtering components at the usb input.

 

-Kari

0 Kudos