-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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: missing spi commands in mipi dbi driver #68815
Comments
@everedero are you compiling with some form of optimizations enabled? Based on the probe you sent it seems that [ili9xxx_set_mem_area](https://github.com/zephyrproject-rtos/zephyr/blob/main/drivers/display/display_ili9xxx.c#L57 is simply not sending the command bytes. I can't reproduce this locally, compiling I'm testing on SHA 49c7f43, with the SPI clock slowed to 1.5MHz |
It might be a platform-specific issue, because ili9xxx_set_mem_area does jump into the SPI HAL, even for 0x2a and 0x2b commands:
With:
I am using debug optimizations (CONFIG_DEBUG_OPTIMIZATIONS=y). I tried to disable all the optimizations (CONFIG_NO_OPTIMIZATIONS=y... and CONFIG_MAIN_STACK_SIZE=4096 to avoid consequential stack overflow), but the issue persists. |
Maybe so- this one is really strange to me. I'm trying to think what is different about the CASET and PASET commands. I've tested on an ST board just to be sure, and my ILI9xxx display works fine there (with |
It does fail consistently, always the same 0x2a and 0x2b disappearing behaviour. |
Ok, so only the command is absent. I'm really not sure what would differ on your setup. You said the HAL is being called to send the command byte. A few questions:
|
|
The display works if I disable interrupt mode for SPI driver:
|
I took a look at your board, and I'm wondering if the |
No, #69200 doesn't affect my issue |
Hmm, ok- can you try removing the You might also want to try running the display sample with |
I tried with duplex removed, still with the fix, with no success. Logging gives: |
@erwango do you have any thoughts here? I'm not clear what changes would cause this to fail. I'm not sure this is a platform specific problem, but I have been unable to reproduce it on other boards thus far |
I was already following the discussion, & I don't really have an idea about what could be causing this
(debugging IT issues is a nightmare). |
Maybe I could somehow try to record the exact calls the display driver is sending to the SPI driver, and compare the old and the new driver calls and timings? There has to be a tiny difference from the upper levels to trigger a different behaviour in lower levels, it cannot just be a curse from my desk, right? 🤔 |
I tried tracing, it is not helping me much, but here it is.
trace_not_working.txt I also tried to print logs directly from the IRQ itself, it looks like it does not disrupt anything after all (the "." is a printk when entering IRQ): I will add more detailed logging, until it either give me interesting information or make everything collapse 😃 |
Turns out everything works if I comment out the spinlock calls in mipi_dbi_spi_write_helper (drivers/mipi_dbi/mipi_dbi_spi.c:61 and 127).
The two missing interrupts popping between MIPI driver call and STM32 SPI LL driver call are back, for some reasons. |
Wow. This is bad- looking at the implementation I did there, that should absolutely be a mutex. Blocking interrupts here doesn't make sense. Unless you'd like to, I'll send a PR (as well as a backport) to fix this |
Taking a spinlock will result in interrupts being blocked in the MIPI DBI driver, which is not desired behavior while issuing SPI transfers, since the driver may use interrupts to drive the transfer Fixes zephyrproject-rtos#68815 Signed-off-by: Daniel DeGrasse <[email protected]>
Taking a spinlock will result in interrupts being blocked in the MIPI DBI driver, which is not desired behavior while issuing SPI transfers, since the driver may use interrupts to drive the transfer Fixes zephyrproject-rtos#68815 Signed-off-by: Daniel DeGrasse <[email protected]>
Taking a spinlock will result in interrupts being blocked in the MIPI DBI driver, which is not desired behavior while issuing SPI transfers, since the driver may use interrupts to drive the transfer Fixes #68815 Signed-off-by: Daniel DeGrasse <[email protected]>
Taking a spinlock will result in interrupts being blocked in the MIPI DBI driver, which is not desired behavior while issuing SPI transfers, since the driver may use interrupts to drive the transfer Fixes #68815 Signed-off-by: Daniel DeGrasse <[email protected]> (cherry picked from commit 5b6fadc)
Taking a spinlock will result in interrupts being blocked in the MIPI DBI driver, which is not desired behavior while issuing SPI transfers, since the driver may use interrupts to drive the transfer Fixes #68815 Signed-off-by: Daniel DeGrasse <[email protected]> (cherry picked from commit 5b6fadc)
Taking a spinlock will result in interrupts being blocked in the MIPI DBI driver, which is not desired behavior while issuing SPI transfers, since the driver may use interrupts to drive the transfer Fixes zephyrproject-rtos#68815 Signed-off-by: Daniel DeGrasse <[email protected]>
Taking a spinlock will result in interrupts being blocked in the MIPI DBI driver, which is not desired behavior while issuing SPI transfers, since the driver may use interrupts to drive the transfer Fixes zephyrproject-rtos#68815 Signed-off-by: Daniel DeGrasse <[email protected]>
Describe the bug
LCD screen does not display images correctly since last ili9xxx drivers update.
There are some commands missing when probing the SPI bus.
Here is what is sent on the bus since the update:
With previous ili9xxx drivers:
Logs and console output
Debugger shows that the calls to send 0x2a and 0x2b are executed:
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: