USB is not enumerated for Kinetics MK64FN microcontroller

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

USB is not enumerated for Kinetics MK64FN microcontroller

Jump to solution
961 Views
kirtiraje
Contributor III

Hello,

I have successfully accessed USB OTG on FRDM K64FN development board. I have used FSL_USB_STACK in device mode. Now I have designed our own board using same controller i.e MK64FN1M0VLL12 and trying to connect USB OTG on the same. The  connections for USB are as shown in attached image. My issue is that, USB is not getting enumerated when connected in port on new board. The difference between the CPU configuration of development board and designed board is that the dev board uses external reference clock of 50 MHz and I am using external crystal of 32 MHz as clock source. All other CPU settings are same for  both the boards.USB_connections.JPG

Can any one help me to find out the cause of this issue.

Thanks in advance

Kirti

0 Kudos
1 Solution
722 Views
kirtiraje
Contributor III

HI Mark,

Finally my USB on new board is enumerated. Issue was with the hardware. I have used external crystal of 32 MHz but the actual frequency of crystal is 10.75MHz. I have replaced the crystal with 12 MHz and accordingly done the CPU settings and USB is working fine now.

Thank you for your help..

Kirti

View solution in original post

0 Kudos
7 Replies
722 Views
mjbcswitzerland
Specialist V

Hi Kirti

A typical mistake in HW designs is missing the 2.2uF (low ESR) capacitor on the VOUT33 pin. Without this, USB will tend not to operate.

If this is Ok make sure that the USB clock is being correctly set to 48MHz.

Regards

Mark

 


uTasker developer and supporter (+5'000 hours experience on +60 Kinetis derivatives in +80 product developments)
Kinetis: http://www.utasker.com/kinetis.html


USB: http://www.utasker.com/docs/uTasker/USB_User_Guide.PDF
USB composites: http://www.utasker.com/kinetis/USB_Device.html
USB-CDC host<->device video: https://www.youtube.com/watch?v=XhISV1czIo4&list=PLWKlVb_MqDQFZAulrUywU30v869JBYi9Q&index=16

0 Kudos
722 Views
kirtiraje
Contributor III

Hi Mark,

Yes, I have connected the 2.2 uF capacitor to VOUT 33 pin. Attached is the screenshot of the same.Vout33_connection.JPG

 USB clock is also set correctly to 48 MHz. Please have a look at CPU settings for external crystal and USB_INIT settings. Still the USB is not enumerated. 

_MK64_CPU_settings_1.JPGMK64_CPU_Settings_2.JPGUSB_init_setting.JPG

While debugging, in CDC1_App_Task() function,

if ((start_app==TRUE) && (start_transactions==TRUE))

start_app and start_transactions flags are not setting to 1 when USB is connected and then it shows ERR_BUSOFF error code. Below are the screenshots  CDC1_App_Task() function.

In_CDC_APP_TASK_fun.JPG

Can you please help to find out, what could be wrong in the settings or in schematic. 

Thank you,

Kirti

0 Kudos
722 Views
mjbcswitzerland
Specialist V

Hi Kirti

I have attached a K64 binary that you can load to your board. It operates from the internal 48Mhz clock so is HW independent and uses it also for crystal-less USB device mode (verified in simulator as below)

If you load it and it enumerates as a hard drive it will verify that your HW is OK, in which case you will need to see whether there are bugs in the generator tools that you are using or incompatibilities in the USB stack with particular clock use.

If it doesn't work (but the output PTE26 is toggling at 2.5Hz to indicate it is alive) it means that you have a HW problem still. Check also that you have 3V3 on VOUT33 when USB is connected.

Regards

Mark

pastedImage_1.png


uTasker developer and supporter (+5'000 hours experience on +60 Kinetis derivatives in +80 product developments)
Kinetis: http://www.utasker.com/kinetis.html
slashing development times and costs...



0 Kudos
722 Views
kirtiraje
Contributor III

Hi Mark,

Thanks for the reply.

I have loaded the attached  .bin file on my hardware board using J link segger. The file is loaded successfully. But USB did not enumerated. It is showing unknown USB device (device descriptor failed) in device manager but the LED connected to PTE26 is toggling. Does that means,still there is problem in my hardware?

I am getting 3.3 V on Vout 33 when USB is connected.

I have also tried using internal 48MHz (IRC 48MHz) clock in my CPU setting but still the USB did not enumerated.

I don't understand the problem is in hardware or in software settings.

Thanks,

Kirti

0 Kudos
722 Views
mjbcswitzerland
Specialist V

Kirti

The binary file operates on the FRDM-K64F board.

If your test with 48MHz clock was also unsuccessful it strongly suggests a HW issue.

Regards

Mark

0 Kudos
723 Views
kirtiraje
Contributor III

HI Mark,

Finally my USB on new board is enumerated. Issue was with the hardware. I have used external crystal of 32 MHz but the actual frequency of crystal is 10.75MHz. I have replaced the crystal with 12 MHz and accordingly done the CPU settings and USB is working fine now.

Thank you for your help..

Kirti

0 Kudos
722 Views
kirtiraje
Contributor III

Hello Mark,

Thank you for the reply. I will go through the schematic again and check it out the hardware.

Thanks,

Kirti

0 Kudos