yocto-pitrezor icon indicating copy to clipboard operation
yocto-pitrezor copied to clipboard

How to add a screen?

Open Ph0rk0z opened this issue 5 years ago • 23 comments

The OLED recommended is over $32 at this stage. I bought a 256x256 SPi with identical footprint. How can I compile in support for it? The display can just be scaled, could it not?

It's this one: https://www.adafruit.com/product/4506

Ph0rk0z avatar Aug 09 '20 15:08 Ph0rk0z

For the 256x256 lcd, scaling would probably look awful because the fonts and picture are designed to work in 128x64. However, maybe by modifying the code it could be possible to use a portion of the 128x64 display, leaving the remaining as black. For the hdmi to lcd I'm not quite sure it could work I think you can find other retailers less expensive than 32$. Here is one for instances : https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20200810043615&origin=y&SearchText=SH1106+oled+1.3

heneault avatar Aug 10 '20 12:08 heneault

I would like to know the same, I have a 1.3" 240x240 SPI Display (https://www.waveshare.com/1.3inch-lcd-hat.htm) Could you point me in the right direction what files we need to change and I can look at the code myself?

icefirex avatar Aug 14 '20 23:08 icefirex

I can prepare a sample that stimulate only the oled so that you can modify/compile/test it directly without docker and the whole build system.

heneault avatar Aug 15 '20 18:08 heneault

Absolutely. That would be soo highly appreciated, I already found drivers and code for the chipset display board I'm using and it should be a good thing for me to implement.

icefirex avatar Aug 15 '20 19:08 icefirex

ok. I will prepare for next week

heneault avatar Aug 15 '20 20:08 heneault

I added a sample that test my oled driver. It just initialize the oled and display the trezor logo on it. I tested it on raspios buster lite version but should work with other flavor of raspios too. Here is the instruction to play with it:

# install bcm2835 library
wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.60.tar.gz
tar zxvf bcm2835-1.60.tar.gz 
cd bcm2835-1.60
sudo ./configure
sudo make && sudo make check && sudo make install

# clone project and run sample
git clone https://github.com/heneault/trezor-firmware.git
cd trezor-firmware/legacy/emulator/pizero/sample
nano test_oled.c # Update OLED_TYPE and FLIP variables
make
sudo ./test_oled

To support a new oled device, you will have to modify the oled_drivers.c file (and add a new entry in the oled_drivers.h) . Don't modify the size of the buffer (128x64) in test oled.c . It must remains like this to be aligned with the original trezor firmware. You will have to do the manipulation in oled_drivers.c only.

I suggest that you begin by finding a demo program that show something on your oled. Then you should be able to migrate the spi/i2c commands used to the oled_drivers.file structure.

heneault avatar Aug 18 '20 17:08 heneault

Absolutely. That would be soo highly appreciated, I already found drivers and code for the chipset display board I'm using and it should be a good thing for me to implement.

Hello, Okay? Were you able to resolve the issue? I really have a problem.

UncleSamKuia avatar Mar 21 '21 03:03 UncleSamKuia

Does this project work with SSD1306 Driver chip? the display works fine with my Arduino project but if I use it on raspberry pi 0 with the Library I don't get any kind of picture and the test above doesn't work I the type doesn't exists?

Lanson2232 avatar Jul 15 '21 04:07 Lanson2232

I think the SD1306 should work with the proper setting. Check if it is properly soldered and if you soldered it to the proper pins

heneault avatar Jul 25 '21 20:07 heneault

@heneault I'm a little confused, I've tried everything possible but it doesn't work. may the problem be that the screen is blue-black? does this project support other colors on screen?

Lanson2232 avatar Oct 12 '21 07:10 Lanson2232

Do you which i2c address it uses with the arduino ? Do you have a link to manufacturer ?

heneault avatar Oct 12 '21 23:10 heneault

The I2C adress is 0x3C I buyed the screen from robolinkmarket.com (it's a turkish electronic parts seller)

Information about this product:

Driver Chip : SSD1306 Interface Type :IIC/I2C Working Voltage: 3.3-5V Resolution : 128x64 Display Size : 0.96inch Color : Blue (Background: Black) Size: 27.5x28.5mm

Lanson2232 avatar Oct 13 '21 08:10 Lanson2232

Everything look good. Can you double check if it is connected like the diagram on pitrezor.com ? Maybe you can test on another pi zero if possible ?

heneault avatar Oct 26 '21 01:10 heneault

Hi, I've got the same problem. I set display OLED_ADAFRUIT_I2C_128x64 = 1 in pitrezor.config. I tried all other i2cs as well. I still get not picture on the screen. I bought this display from ebay: https://www.ebay.de/itm/353351582659

I soldered it twice with two sets of wires and also replaced the display, because I thought it was broken.

Edit:

Oh, forget about this, I connected Ground to the wrong pin! Still, it would be useful information for some, that you need to chose the adafruit OLED in the config if you are using an SSD1306.

beatstick avatar Nov 21 '21 14:11 beatstick

@Ph0rk0z did you have any luck with the ST7789 driver?

nathanjnorris avatar Feb 13 '22 22:02 nathanjnorris

I have this working now with ST7789, basically mirroring the HDMI, so should easily be applicable to a range of other screens too. Will get it all done in a yocto friendly way and bring a PR in the next little while.

3rdIteration avatar Aug 20 '22 16:08 3rdIteration

I have this working now with ST7789, basically mirroring the HDMI, so should easily be applicable to a range of other screens too. Will get it all done in a yocto friendly way and bring a PR in the next little while.

Looking for it with impatience

jpph avatar Aug 31 '22 15:08 jpph

I have this working now with ST7789, basically mirroring the HDMI, so should easily be applicable to a range of other screens too. Will get it all done in a yocto friendly way and bring a PR in the next little while.

Are you able to share this?

icefirex avatar Apr 02 '23 19:04 icefirex

The PR is there. You can go to 3diteration's repo, he has all the images there ready to put on sdcard.

jpph avatar Apr 02 '23 19:04 jpph

Is there any way I can enable the RCA output? to connect to an old TV or an RCA screen from a car reversing camera

welltinho avatar Jan 05 '24 09:01 welltinho