-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
drivers: spi: esp32: Continue configuration if SPI clock already running #73534
Conversation
When clock_control_on returns -EALREADY we can continue with SPI configuration because clock is already running. Signed-off-by: Tomáš Juřena <[email protected]>
@LucasTambor Can you take a look whether this issue also exists in other peripherals? |
@darkmoon32 Thanks for the PR. The clock control does expect the The correct way would be to use Would you mind moving the clock initialisation to the init function? For that to work we should also disable and clear the interrupt status for the SPI peripheral before allocating it's interrupt. Here's the diff that worked for me:
|
@LucasTambor I am not sure if I am following you but I agree that the clock initialization should be in the
|
@darkmoon32 Did you apply the changes I suggested? I think we shouldn't handle the Is this log from any sample or test that I can reproduce? Just so you know, I tested my suggestion with Would you mind applying the diff I sent, without any modification and give me a feedback? Just save it in a file, such as Thanks man. If it fixes your issue feel free to update the PR with it. Otherwise we can dig further. |
@LucasTambor The provided log was recorded with your suggested changes. I have pushed a minimal project with the issue here. You can check if there is any other issue which could cause the clock issue. I have included the board configuration but you can use Build cmd: Log from the provided sample if I use
Build cmd for esp32_devkitc_wroom with extra uc8179_waveshare_epaper_gdew075t7 node: Log from the provided sample if I use
I hope it will reproduce the issue for you. |
@darkmoon32 Thanks! Now it is clear to me that the problem still occur with ESP32. The problem is that we wasn't disabling SPI2 and SPI3 clocks for ESP32, and that should only happen when Can you try #73807 and see if it fix your issue? Thanks |
The #73807 worked for me. This PR is therefore outdated so I am closing it. Thanks for your work. |
This PR attempts to fix the issue with the SPI clock that is present after e282b0e changes to the clock_control_esp32.c.