9 years, 5 months ago.

Official USBDevice support for FRDM-K22F?

Hi,

after being sour with my ST Micro Nucleo F401RE board (cannot get the USBDevice library to work on it), I'm looking at alternatives.

The FRDM-K22F board looks like a very sweet board, but for the time being there does not seem to be official USBDevice library support. Am I wrong about this one? Secondly, when do you think there's going to be official support for this board (rough estimate would be appreciated)?

My third request, please keep an up-to-date list for the devices supported by the USBDevice library. Just looking at the platforms themselves, lots of them seem to have usb interfaces BUT are otherwise not supported by the USBDevice library, which is borderline... fraudulent.

Thanks in advance, Marios

Question relating to:

USB device stack device, USB

(For some strange reason, I can't comment directly on your answer Erik, so this is posted as a comment to the original question).

Ah, these are the exact words I DIDN'T want to hear. :( Hopefully it gets sorted out soon. It would be an unbelievable mess to have to depend on specific revisions of specific libraries that are known to work, it would get out of hand very soon..

posted by MARIOS SATANAS 27 Nov 2014

Doesn't matter, I now read it anyway since I was going to respond.

There are some differences in clock selection for USB between K64F and KL25Z (which is the original target for the USB). The old Freescaler register map file was bugged, and did not reflect this difference. Because of this the old code stil worked fine. Meanwhile the fixed the bug, in the last mbed revision we updated that file, and now it doesn't work anymore since the code accidently relied on that bug. Even Freescales own clock setup files still rely on that bug, so are wrong. (At least version we have got).

For us that last part doesn't matter though, USBDevice overwrites USB clock settings, so fixing it in USBDevice is sufficient. When this pull request is accepted by mbed staff: https://github.com/mbedmicro/mbed/pull/746, it should work on the K22F. I verified it on mine using USBMouse_HelloWorld, and it worked perfect :)

posted by Erik - 27 Nov 2014

Ah, great news, I will be picking up this board fairly soon then!

Cheers!

posted by MARIOS SATANAS 28 Nov 2014

Ah, I see the support was just added to USBDevice!

Thanks Erik! :D - End of Thread

posted by MARIOS SATANAS 28 Nov 2014

1 Answer

9 years, 5 months ago.

I know all NXP and all Freescale* platforms with USB should work using USBDevice. I never much looked into STM USB, too much effort without USB connector present ;). (Although the F401 should work).

.* Yes yes, excluding the K22F. But I can add it for the K22F before you would be able to buy a board, it is literally adding two #ifdefs (well I am pretty sure thats all thats needed. I might check it out later today).

Edit: Holy crap I am able to edit answers, it is a miracle

Accepted Answer

Ah, I see, hopefully nothing much has changed, and the two #ifdefs do the trick. If you get around to it, it would be nice to see it in the official repository. :)

Thanks for the reply!

p.s. As for the F401RE... honestly, I've pretty much given up at this point. The USBHal::connect() call just... freezes forever. Tried the same code on a friend's NXP worked fine, first time :(.

posted by MARIOS SATANAS 26 Nov 2014

Well that was easier said than done: Doesn't work on K22F. Verified on K64F, doesn't work either. Previous mbed lib version it does work on (but that lacks K22F support). So something has been broken in that release. I blame Freescale.

posted by Erik - 26 Nov 2014