Author Topic: USB when moving from MK66 to MK24  (Read 757 times)

Offline AlexS

  • Newbie
  • *
  • Posts: 46
    • View Profile
USB when moving from MK66 to MK24
« on: February 02, 2022, 12:18:30 PM »
Hi,

We've switched recently from the MK66FN2M0VLQ18 to MK24FN1M0VDC12 and everything seems to be working, except USB. The first set of prototypes had the pinouts done wrong, but the second design looks ok.  I've attached both the working previous design and the new one.


With the same USB code as before (no configurations changed), the device is correctly recognized by Windows, but getting this error: "The device cannot start (Code 10. An invalid parameter was passed to a service or function.)"

One thing that piqued my interest is that we were using USB1 before, but USB0 now. However I can't seem to find where the USB peripheral ID is configured.

Thanks!
« Last Edit: February 02, 2022, 01:00:44 PM by AlexS »

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3191
    • View Profile
    • uTasker
Re: USB when moving from MK66 to MK24
« Reply #1 on: February 03, 2022, 05:12:28 AM »
Hi

Beware that USB0 on the K66 and K24 is a Full Speed USB controller (12Mb/s) and USB1 is a high speed USB controller (480Mb/s) and so if you have moved from USB1 to USB0 you need to make sure that you use the correct USB interface (0 rather than 1) when opening it
Code: [Select]
tInterfaceParameters.ucUSB_controller = 0;and also that you specify that its endpoint characteristics are suitable for FS USB (eg. maximum bulk endpoint size is 64 bytes rather than 512 bytes).

It may be that it is enumerating but the PC recognises that its descriptors are not suitable and so shows a configuration error.

Regards

Mark

Offline AlexS

  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: USB when moving from MK66 to MK24
« Reply #2 on: February 23, 2022, 10:26:05 PM »
Thank you, Mark! That worked, but as we are doing stress testing before moving over to the new processor, we're seeing some very weird USB behavior. Will create a new thread to not mix this up.

Offline tdrobnak

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: USB when moving from MK66 to MK24
« Reply #3 on: March 16, 2022, 11:09:18 PM »
Hi Alex,

I had a similar problem with the USB connectivity as you are experiencing in 2014.  On our design, it was found that we had undersized the capacitor for the VOUT33 pin for the MK22 processor we used in a project.  I see the capacitance is 100nF for your design.  This might be too low and cause noise issues on the USB's internal power supply that VOUT33 is designed to supply.  Our design uses a 2.2uF capacitor.  It is not well documented in the reference manual for the microcontroller, but I did find that Freescale's (now NXP) KwikStik-K40 Hardware Errata document on Errata ID KWIKSTIK_06 states "Undersized VOUT33 Capacitor" and the solution on page 10 of that document states: "The recommended value for the capacitor from VOUT33 to GND is from 1.76uF to 8.16uF with 2.2uF being the typical value. The capacitor (C34) connected to VOUT33 on the KwikStik is only 0.1uF. This can result in unstable or non-functioning USB operation.  Workaround: Replace C34 with a capacitor of value 1.76uF to 8.16uF".  The link to the document is: https://www.nxp.com/docs/en/errata/KWIKSTIKK40HWER.pdf

There is also a NXP Community discussion on the USB internal regulator (VOUT33) with NXP TechSupport suggesting a 2.2uF capacitor.  The link for this conversation is:
https://community.nxp.com/t5/Kinetis-Microcontrollers/MK22DX256VMC5-VOUT33-output-not-good-when-VREGIN-changes/m-p/741454?commentID=965047

Hope this helps,

Tom