AnsweredAssumed Answered

Porting MKL26Z USB device code to MKL27Z

Question asked by Joey Gouly on Sep 22, 2015
Latest reply on Sep 23, 2015 by Mark Butcher

Hi all,

 

I'm trying to port the USB code from https://github.com/PaulStoffregen/cores/tree/master/teensy3  from the MKL26Z to the MKL27Z.

 

Other than using USB0_CLK_RECOVER_CTRL and USB0_CLK_RECOVER_IRC_EN to use the 48 MHz clock, would there be any other changes necessary?

Is the USB core otherwise the same?

 

I'm using the keyboard descriptors, I'm trying to send a key. That works.. but then it just repeatedly sends the same character over and over again.

 

I call usb_keyboard_send() https://github.com/PaulStoffregen/cores/blob/master/teensy3/usb_keyboard.c#L470

Which calls usb_tx() cores/usb_dev.c at master · PaulStoffregen/cores · GitHub

 

After that, I get a USB interrupt with TOKDNE set in ISTAT, endpoint 1 (the keyboard enpdoint)

I don't get any other USB interrupts after that (apart from SOFTOK only, which I don't print because there are so many of them).

Yet, the same character prints to my screen forever.

 

Anyone got any ideas?

 

Outcomes