Skip to content
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

Fix USB crashes in FreeRTOS #1419

Merged
merged 1 commit into from
May 2, 2023
Merged

Fix USB crashes in FreeRTOS #1419

merged 1 commit into from
May 2, 2023

Conversation

earlephilhower
Copy link
Owner

Fixes #1402

The global USB mutex is auto-shadowed with a FreeRTOS semaphore while in FreeRTOS mode. Unfortunately, while the core was using the proper FreeRTOS semaphore to lock access to the USB port, the actual FreeRTOS USB task was using the naked Pico SDK mutex, leading to cases where it could acquire the mutex even though some other FreeRTOS task actually owned the shadowed mutex.

Properly lock the shadowed Semaphore, not mutex_t, in the FreeRTOS USB periodic task.

Fixes #1402

The global USB mutex is auto-shadowed with a FreeRTOS semaphore while in
FreeRTOS mode.  Unfortunately, while the core was using the proper
FreeRTOS semaphore to lock access to the USB port, the actual FreeRTOS
USB task was using the naked Pico SDK mutex, leading to cases where it
could acquire the mutex even though some other FreeRTOS task actually
owned the shadowed mutex.

Properly lock the shadowed Semaphore, not mutex_t, in the FreeRTOS
USB periodic task.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FreeRTOS + LittleFS and USBSerial cannot be used at the same time
1 participant