USB with MQX 4.2

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

USB with MQX 4.2

908 Views
ryanlush
Contributor IV

I have a USB device project based on MQX 4.0 that I'm porting to MQX 4.2. Right off the bat the device fails the set address command. A search for  _usb_device_set_address yields 8 hits and I'm not hitting breakpoints on any of those calls. Where is the initial negotiations of device descriptors and so on? I also notice there is both a usb and usb_v2 directory in my MQX directory. What is the difference between the two?

0 Kudos
6 Replies

603 Views
ryanlush
Contributor IV

I enabled the 48MHz internal reference clock in the BSP and everything started working. I don't know what I am doing wrong with the PLL but I got things working for now and it confirms my suspicion that this is a clocking issue.

0 Kudos

603 Views
ryanlush
Contributor IV

The only interrupt I get is for the error bit. When I check the ERRSTAT register I see that the PIDERR bit is set. This is the only interrupt I get. I never get the TOKENDONE interrupt which is where most of the USB handling code is triggered. This feels like a clocking issue to me but I have run out of clock settings to check. What would prevent me from ever getting the TOKENDONE interrupt?

I should point out I have USB working in the bootloader so I don't think this is a hardware issue.

I don't see anything in the documentation that tells me which stack to use with which processors and I am also told by NXP that there is no difference in the USB hardware between the K20 and the K24 with the exception of some crystal-less operation on the K24. All of that hardware is disabled as far as I can tell.

0 Kudos

603 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Ryan:

Yes, there are two usb stacks in MQX 4.2 package.

Freescale_MQX_4_2\usb :  this is a legacy usb stack, same as in MQX 4.1 or earlier versions. it supports some old kinetis chips.

Freescale_MQX_4_2\usb_v2 :  this is a completely new design, the usb stack is same as that in KSDK 1.3. it supports k22/k24/k64/k65/svf522

Regards

Daniel

0 Kudos

603 Views
ryanlush
Contributor IV

Mark Butcher tells me the USB peripherals are nearly identical between K20 and K24. I already have code written for the legacy stuff. What’s the trick to get it to work?

Thank you,

Ryan

(sent from mobile device)

0 Kudos

603 Views
danielchen
NXP TechSupport
NXP TechSupport

I would suggest you refer to the two documents under the MQX installation folder, the two documents describes how to use the Freescale MQX USB stack.

Freescale MQX RTOS USB Device User's Guider and Freescale MQX RTOS USB Device API reference Manual

Freescale\Freescale_MQX_4_2\doc\usb

Regards

Daniel

0 Kudos

603 Views
ryanlush
Contributor IV

Gee thanks... Why didn't I think of that?

0 Kudos