Giter Club home page Giter Club logo

Comments (4)

larsgk avatar larsgk commented on July 1, 2024

Hi again,

I did some more research on this issue (that more than me seem to have - according to some entries on mbed.org).

There are several issues (all tested on FRDM-KL25Z):

  1. if you try to construct USBSerial with nothing connected to the USB Comm port, the program hangs in a forever loop here (I commented it out to be able to do battery/wireless operation - and this seems to work quite nicely.. the device can be switched on while connected or not .. reconnects work just fine, etc.):

https://github.com/mbedmicro/mbed/blob/master/libraries/USBDevice/USBDevice/USBDevice.cpp#L711

  1. if you pull the plug while in a transfer, the program hangs in a forever "pending" loop here:

https://github.com/mbedmicro/mbed/blob/master/libraries/USBDevice/USBDevice/USBDevice.cpp#L835

I am going to try to see if there is any way (maybe only for the FRDM-KL25Z board specifically) to detect if there is something connected to do a graceful startup/shutdown of the USB chain.

Also - if the code in USBDevice.cpp#L835 knows that it's pending for a long time (e.g. 20 checks..) then there should be a way to throw an exception (I know... not exception but C-style callbacks, etc.) up through the chain AS WELL as doing a graceful shutdown/reset of anything in the transfer buffer. The current mechanism leaves room for improvement at least :) - I am happy to contribute with my findings but please help me out a bit..we have to deliver 30 educational packages to a high-school soon.. based on this.

br
Lars

from mbed-os.

larsgk avatar larsgk commented on July 1, 2024

I am wondering why the writable operation is not implemented to return something useful?

https://github.com/mbedmicro/mbed/blob/master/libraries/USBDevice/USBSerial/USBSerial.h#L99

from mbed-os.

ciarmcom avatar ciarmcom commented on July 1, 2024

ARM Internal Ref: IOTMORF-331

from mbed-os.

 avatar commented on July 1, 2024

GitHib issue review: Closed due to inactivity. Please re-file if critical issues found.

from mbed-os.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.