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

Mutex type semaphores cannot be used from within interrupt service routines. #34

Open
sp3esu opened this issue Jan 6, 2022 · 1 comment

Comments

@sp3esu
Copy link

sp3esu commented Jan 6, 2022

Hi.

While working on my modification of Sound Engine I got an issue that while reading some I2C sensors software crashed. After a small investigation, I found that the I2C driver fails in using semaphore. I found such note in the documentation: "Mutex type semaphores cannot be used from within interrupt service routines."

After removing semaphore usage in the interruption handler function everything is working fine.

if ( xSemaphoreTake( xPwmSemaphore, portMAX_DELAY ) )

Replace xSemaphoreCreateMutex with xSemaphoreCreateBinary is not making any change - software is still crashing.

This can lead to other unexpected issues, so I suggest changing the way how channels data is synchronized. I didn't figure out it yet by myself. If I find a way I'll create PR.

Best Regards!
Gregor

@Schrottschrauber
Copy link

Hello,
when integrating the I2C DAC MCP4728 to control a power servo I also get constant RESETS.
The initialization works fine, but I get resets when outputting the speed.
Can you tell me exactly what you have changed so that it works?

I am grateful for any help

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

No branches or pull requests

2 participants