-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
usbtrace causes crash #12181
Comments
@Virus-V nice work finding and debugging this issue! Kudos!!! @xiaoxiang781216 @raiden00pl any suggestion? @Virus-V maybe using RAMLOG as SYSLOG instead of SYSLOG over serial could help, them you just run dmesg later to see what happened. Note: take care with using USB Trace, as Greg explained some years ago: when you add tracing you are changing the timing of USB and it could introduce issues. |
This is a known issue we found many time before: #1138 |
It is unsafe to call syslog in a critical section. Not only usbdev, there are similar codes in other drivers in nuttx (such as drivers/timers/pwm.c). |
let's close this issue and focus on #1138 |
When I was debugging the STM32F405 USB function, I encountered a crash.
It seemed that the data structure was damaged.
The cause of this problem is that the interrupt was responded to in the critical section.
This problem only occurred after I turned on the USB DEBUG function.
I found that in the
syslog_putc
function, different output functions are called according to the current calling context.However, it does not handle the current situation in the critical section, resulting in task scheduling and interrupts being turned on in the critical section.
The text was updated successfully, but these errors were encountered: