-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logger <LOGGER_INTERNAL> doesn't work (maybe concurrency issue) #588
Comments
Hi Raphael! I'm sorry for the delay in response. We'll have a closer look at this when we get a chance. |
So I haven't quite been able to reproduce this yet, but I have seen the occasional windows warning complaining of an unknown device. This doesn't seem to exactly match what you're running into, but it could very well be related. Most of the class functions (CDC_Transfer/Receive Packet) seem to fail safely if the USB has not completed setup. Do you have any other code that would execute within that first 1000ms delay you posted as a workaround that would block IRQs from happening? A few things that would make this easier to track down (and to potentially avoid) would be a bit of added error handling to both the Logger, and the UsbHandle classes, as well as the ability to check current connection/USB status. I'll continue to look into this. If you could provide a minimal example that triggers this error for you (even if only intermittently) that would be quite helpful. |
I seem to be getting the same issue. Serial works very intermittently. Even just whittling down the example to the basics the serial port doesn't show up on mac anymore:
Tried different cables (even though these all worked in the past), tried adding the Weirdly this worked at times in the past. Even this minimal example. |
Description
When using the Logger over "internal USB", logging either does work, or doesn't work at all, or just a few frames of logs are received and then it doesn't work anymore.
Analysis
After
impl_.Init();
is called,PrintLine
will immediately start toCDC_Transmit_FS
.At some point of time, a
OTG_FS_IRQHandler
interruption will be fired, in which it will setup the CDC.Typically when the bug happens:
The first time
CDC_Transmit_FS
is called:hcdc
isNULL
, and it seems thathcdc
is big enough for theTxState
to be mapped to an address that can be at least read.Workaround
I introduced a delay between
impl_.Init();
and beforeCDC_Transmit_FS
is first called:And that seems to solve it, at least when the program is living in the
FLASH
section.The text was updated successfully, but these errors were encountered: