Hi all,
I recently got a FRDM-MKL26Z dev board and I'm having trouble getting USB up and running.
I took some code from the Teensy repository ( cores/teensy3 at master · PaulStoffregen/cores · GitHub ) and the USB code from this project ( kcuzner/teensy-oscilloscope · GitHub )
However, when I compile and flash the board the only USB interrupt that fires are 'reset' and 'sleep'.
I was wondering if someone could look at my code, and see if anything looks wrong.
I guess the main points of interest would be the following:
init_clocks_ref() : frdm-mkl26z/mkl26z64.c at master · jgouly/frdm-mkl26z · GitHub
usb_init() : frdm-mkl26z/usb.c at master · jgouly/frdm-mkl26z · GitHub
USBOTG_IRQHandler() : frdm-mkl26z/usb.c at master · jgouly/frdm-mkl26z · GitHub
Any help or guidance would be great, and if you need more information, let me know!
Thanks,
Joey
Note:
This question seems similar to USB k20_100: no TOKENDNE interrupt. Please help. but it was never resolved.
Hi Joy
Did the comparison with the register settings allow you to close in on a particluar area to look into in more details to solve the issue?
Did you get any feedback at the original developers' web sites?
Regards
Mark
Kinetis: µTasker Kinetis support
K20: µTasker Kinetis TWR-K20D72M support / µTasker Kinetis FRDM-K20D50M support / µTasker Kinetis TWR-K20D50M support / µTasker Kinetis support
KL26: µTasker Kinetis FRDM-KL26Z support / µTasker Kinetis Teensy LC support
Composite USB: µTasker USB Device Configuration
USB User's Guide: http://www.utasker.com/docs/uTasker/USB_User_Guide.PDF
For the complete "out-of-the-box" Kinetis experience and faster time to market
Hi Mark,
I've been busy and haven't had any time to ask on the PJRC forums, I was just bumping the thread here to see if I could get any other help!
The weekend is closing in, then I'll have time to get my hands dirty!
Thanks,
Joey
Hi Joey
You can take a look at http://www.utasker.com/kinetis/FRDM-KL26Z.html
This contains USB composite device support for the FRDM-KL26Z (single or multiple CDC plus MSD and HID), also works with the Teensy 3.1 µTasker Kinetis support and is prepared for the Teensy LC µTasker Kinetis Teensy LC support
If you have only USB status change interrupts it is probably a clocking problem but the above code will work out of the box and should give you a lot more features and is industrially proven. You can also work with (free Express edition) VisualStudio and simulate the boards in (approx.) real-time. Completely free for non-commercial use and supported in this forum.
Regards
Mark
Kinetis: µTasker Kinetis support
K20: µTasker Kinetis TWR-K20D72M support / µTasker Kinetis FRDM-K20D50M support / µTasker Kinetis TWR-K20D50M support / µTasker Kinetis support
KL26: µTasker Kinetis FRDM-KL26Z support / µTasker Kinetis Teensy LC support
Composite USB: µTasker USB Device Configuration
USB User's Guide: http://www.utasker.com/docs/uTasker/USB_User_Guide.PDF
For the complete "out-of-the-box" Kinetis experience and faster time to market
Hi Mark,
Thanks for the links!
Would you be able to point to some useful parts of the code, such as USB handling, setting the clocks etc?
I would prefer to get the code I have working, since I may end up trying to port existing code that is very similar, or uses the Teensy code.
Thanks!
Joey
Hi Joey
If you load the reference binary in the link you can compare clock registers with those that you have (using the debugger) and possibly find a difference that explains a problem.
Otherwise it may be best to ask for help at the Teensy forum if your code needs to be based on it: https://forum.pjrc.com/forum.php
Note that the Teensy LC's KL26 is not identical to the FRDM-KL26's since it is a cut-down version of it.
Regards
Mark
Kinetis: µTasker Kinetis support
K20: µTasker Kinetis TWR-K20D72M support / µTasker Kinetis FRDM-K20D50M support / µTasker Kinetis TWR-K20D50M support / µTasker Kinetis support
KL26: µTasker Kinetis FRDM-KL26Z support / µTasker Kinetis Teensy LC support
Composite USB: µTasker USB Device Configuration
USB User's Guide: http://www.utasker.com/docs/uTasker/USB_User_Guide.PDF
For the complete "out-of-the-box" Kinetis experience and faster time to market