SSD1306 driver no longer works for I2C displays #33606
-
Describe the bug I have examined the behaviour of the code running on an old device and the current zephyr version with a logic analyser using the exact same SSD1306 display (I moved it between devices). On the old device it works fine, but with the latest zephyr version it no longer works. I also tried several different SSD1306 displays and they all had the same issue. To communicate with the SSD1306 displays over I2C, the datasheet says that one must send a control byte, and then a data byte, repeating this pair of bytes as necessary. See page 20 here: https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf In this commit: fd2087e the sending of control bytes appears to be deliberately removed except for the very first one, presumably to make the code work for SPI displays. However, this has broken i2c support in my case. Also, the use of the If I revert all of the changes in that commit above, the display will then turn on, but all I see is noise. I also need to adjust the code to replace the line here with a non-burst write: zephyr/drivers/display/ssd1306.c Line 241 in e18fcbb Once I make those changes, the display works correctly as expected. To Reproduce
Steps to reproduce the behavior (for
Impact Environment (please complete the following information):
Additional context
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Further digging implicates the
|
Beta Was this translation helpful? Give feedback.
-
It appears that this problem has been encountered before on the Nordic devices: e6fe542 |
Beta Was this translation helpful? Give feedback.
-
There are display samples, for &arduino_i2c {
status = "okay";
zephyr,concat-buf-size = <2048>;
ssd1306@3c {
compatible = "solomon,ssd1306fb";
reg = <0x3c>;
label = "SSD1306";
width = <128>;
height = <64>;
segment-offset = <0>;
page-offset = <0>;
display-offset = <0>;
multiplex-ratio = <63>;
segment-remap;
com-invdir;
prechargep = <0x22>;
};
}; But I think it is better to use |
Beta Was this translation helpful? Give feedback.
There are display samples,
samples/subsys/display
, and different SSD1306 compatible shields,boards/shields/ssd1306
. It would be more than appropriate to use these for reporting bugs, especially with an I2C display controller.for
compatible = "nordic,nrf-twim";
you need to add "zephyr,concat-buf-size " to your devicetree overlay: