Comments (4)
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):
- 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
- 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.
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.
ARM Internal Ref: IOTMORF-331
from mbed-os.
GitHib issue review: Closed due to inactivity. Please re-file if critical issues found.
from mbed-os.
Related Issues (20)
- Buffer overflow vulnerablilty in MbedOS BLE Cordio stack HOT 2
- STM32WL USART2@2400 not working with every device HOT 6
- STM32WL System Clock differs at boot/reset and after deepsleep HOT 2
- Mbed CLI 2 USB no such file or directory HOT 2
- mbed-tools deploy is limiting the git fetch specification HOT 2
- STM32_gen_peripheralPins.py chrashing after generating pinmaps HOT 3
- Linking with error: "cannot move location counter backwards" HOT 1
- BLE start routine freezes when the event_queue dispatching inside mbed-os-ble-utils moved to a thread HOT 1
- Include directive issue with BLE API HOT 1
- PD_14 is not labeled as a SPI CS pin for Nucleo-F413ZH HOT 5
- time(NULL) not returning real RTC value after reboot HOT 1
- PC_13 is unlisted HOT 2
- TARGET_STM32F303xC: SetSysClock() missing HOT 2
- Update hidapi used for non-Linux platforms HOT 2
- Flashing Controller from Docker Container HOT 2
- mbed::CircularBuffer interrupt safe but not thread safe? HOT 2
- STM32 I2CSlave race condition causing timeouts
- LoRaWAN no OTAA Uplink on AS923 region STM32WL HOT 3
- STM32U5 HSI and HSE SetSysClocks missing (only MSI implemented) HOT 1
- STM32 Cellular/LWIP/PPP 100ms periodic wake after shutdown
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mbed-os.