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

Cant setup a 3.5 inch lcd RPi display on raspberry pi 4 #245

Closed
alloncm opened this issue Nov 11, 2021 · 1 comment
Closed

Cant setup a 3.5 inch lcd RPi display on raspberry pi 4 #245

alloncm opened this issue Nov 11, 2021 · 1 comment

Comments

@alloncm
Copy link

alloncm commented Nov 11, 2021

Hi, Im trying to setup a 3.5 inch lcd RPi display I got from a friend.

I couldn't find a good docs about this display except for this site -
http://www.lcdwiki.com/3.5inch_RPi_Display
From what I understand this is an ILI9486 display so this driver support it.

Im probably not configuring the correct build parameters but I have tried twicking them for my understanding (it is my first hardware project so I dont have a lot of experience with RPI and those things) but everytime I get a white screen (sometimes it blinks a bit), also the terminal output seems to be fine.

The last command I tried to compile with:

cmake -DSPI_BUS_CLOCK_DIVISOR=40 -DGPIO_TFT_DATA_CONTROL=-1 -DGPIO_TFT_RESET=22 -DILI9486=ON ..

The terminal output when running as sudo:

bcm_host_get_peripheral_address: 0xfe000000, bcm_host_get_peripheral_size: 25165824, bcm_host_get_sdram_address: 0xc0000000
BCM core speed: current: 233333333hz, max turbo: 500000000hz. SPI CDIV: 40, SPI max frequency: 12500000hz
Allocated DMA channel 7
Allocated DMA channel 1
Enabling DMA channels Tx:7 and Rx:1
DMA hardware register file is at ptr: 0xb5388000, using DMA TX channel: 7 and DMA RX channel: 1
DMA hardware TX channel register file is at ptr: 0xb5388700, DMA RX channel register file is at ptr: 0xb5388100
Resetting DMA channels for use
DMA all set up
Initializing display
Creating SPI task thread
InitSPI done
DISPLAY_FLIP_ORIENTATION_IN_SOFTWARE: Swapping width/height to update display in portrait mode to minimize tearing.
Relevant source display area size with overscan cropped away: 1080x1920.
Source GPU display is 1080x1920. Output SPI display is 320x480 with a drawable area of 320x480. Applying scaling factor horiz=0.25x & vert=0.25x, xOffset: 25, yOffset: 0, scaledWidth: 270, scaledHeight: 480
Creating dispmanX resource of size 270x480 (aspect ratio=0.562500).
GPU grab rectangle is offset x=0,y=0, size w=270xh=480, aspect ratio=0.562500
All initialized, now running main loop...

The blank white screen:
IMG_20211112_003949.jpg

Pictures of the display:
IMG_20211112_004347.jpg
IMG_20211112_004316.jpg

Thanks in advance :)

@alloncm
Copy link
Author

alloncm commented Nov 20, 2021

Update:

After messing with this for this weekend too I have managed to get my RPI4 to output to this screen.
Ill describe here what I did in case someone will try it too in the future.

After further reading my screen docs and fbcp readme I have noticed that my screen sku is MPI3501 which is supported after this issue #40, I tried compiling to this with no success (I guess Im lucky? cause this screen seems to be shit).
After some more reading I reached this issue #191 and noticed that the screens connector looks similar and that he used some other screen config.
Anyway this command for the waveshare 35b worked for me!

cmake -DWAVESHARE35B_ILI9486=ON -DSPI_BUS_CLOCK_DIVISOR=24

Im using 24 in the clock divisor cause any number smaller than this will make the screen either stay white or display corrupted image.

The screen is a bit laggy so I might buy a better screen (with maybe more support for this driver).

Just to check, the corruption when trying to use clock divisor smaller than 24 is an expected behavior?

@alloncm alloncm closed this as completed Nov 20, 2021
@alloncm alloncm reopened this Nov 21, 2021
@alloncm alloncm closed this as completed Dec 17, 2021
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

1 participant