I’ve been searching for a while how to properly use USB connections in mbed. Unfortunately, I haven’t found anything much - and honestly - I feel too lazy to absorb the whole USB protocol RFC papers and bite though all the tiresome abstracts…
Could you please point me where I could get some more materials in more tangible form, or even prefferrably - if there are some best practices / examples directly for mbed framework?
More specifically, I ran into some issues with my prototype and I don’t know where to get answers for them. All of these are related to USBSerial only.
Connection reneval. If I restart the board, the usb connection is not reestablished (even when I call
.disconnect(); .connect();To fix this state, I have to plug the usb out and in again.
Waiting for connection.
usb.wait_ready();causes mbed hard fault crash regardless anything I try to write around it.
Reading data as FileHandle. Even when USBSerial (as well as BufferedSerial) inherits FileHandle, the behavior is obviously different. What is the actual difference? Namely, it seems that
file.read(buf, size_t bytes);ignores the
set_blocking(bool)settings and acts weird (I wasn’t able to map it thorougly since the debugger in mbed studio does not work for me after update to 1.4 …)
These three are just initial problems and I believe I could find my own solution/workaround but there’s so few materials about this classes I do not know where else to look.
Thanks for all advices.