I am trying to use the MK60 and the MK64 as a Mass Storage Device via USB. In the beginning I started with the Freescale TWR K60D100m and it works fine. The TWR is connected as a MSD.
Afterwards I tried the same with my custom hardware (also MK60) and nothing happened. I tried the same with the MK64 (also custom hardware) and still nothing happens.
I guessed the pullup resistor at D+ is not activated. That's why I used an external Pull Up Resistor and the device was recognised as an Unknown Device... the problem was, that it stayed unkown. I read, that it is possible, that the USB is initializing to slow and that the PC doesn't wait long enough for the device.
That's why I want to try it with the internal Pull Up Resistor at D+ of the MK60 and/or the MK64. My problem is, that I don't know, how I can do this. Can you help me?
I am using Kinetis Design Studio and KSDK 1.3
Thansk for the answers! I checked vregin and vout33 and noticed, that those are not connected. That means, we don't have power on the usb controller.
The problem is, that we have to change the layout completely, which will take us 3-4 weeks.
I checked the K60 reference manual and noticed, that there is a USB bus power supply where VOUT33 is connected to VDD. Can I do this with the software? Maybe with setting a register? Or do we have to change the layout and fix the hardware?
Thank you for your help!
It seems to be more a hardware than software problem but anyway, Pull-up resistors are enabled in usb_dci_khci_init funcion at khci_dev.c file (located at usbd_sd_bm_lib_MK64F12 > usb_core > device > sources > controller_driver > khci
/* Weak pull downs */
/* reset USB CTRL register */
/* Enable internal pull-up resistor */
usb_hal_khci_set_trc0(usb_dev_ptr->usbRegBase); /* Software must set this bit to 1 */
Other importat thing to be considered is that USB's clock should be set to 48 MHz and CPU's clock must be greater than 20 MHz in order to work properly. Also, here are other "common" errors that avoid USB Device to be recognized by PC:
For hardware's point of view, It is important to add a Capacitor on VOUT33 terminal.
Also, make sure that USB hardware is similir to the one used in FRDM-K64F:
I hope this helps!
It is not good to work with fixed pull-ups so these should certainly be removed.
The way that the D+ line is pulled up when the USB interface is configured is using (similar code to) the following:
USB_USBTRC0 = USB_USBTRC0_RES; // this bit is not defined but should be set for correct operation
USB_OTG_CONTROL = USB_OTG_CONTROL_DPPULLUPNONOTG; // enable pull up on D+ for full speed operation
Check also your VREG_IN/VREG_OUT circuitry too since I have worked on various Kinetis based USB device projects on custom boards and almost half of them needed to correct this because the prototype design was not correct....
Edit: I was too fast with this question.. looks like it takes some time until the answers are moderated. I will check your answers first, thank you very much!
I used the device with the MK60 and the external Pullup Resistor again. When I debug it and connect the device via USB, the Reset Interrupt gets called. I think that's the way it should be.
But windows shows the device as unknown.. I am not sure, why it doesn't work. I guess the USB device is too slow with the initialization because windows recognizes that something was attached immediately.
Anyone knows, why the device is unknown? And how can I fix it?