cd LCD-show/
sudo ./rotate.sh 90
b) By reinstalling and setting the rotation at the very beginning - nothing changedsudo rm -rf LCD-show
git clone [url]https://github.com/goodtft/LCD-show.git[/url]
chmod -R 755 LCD-show
cd LCD-show/
sudo ./MHS35-show
dtoverlay=mhs35:rotate=90
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See lin>
# uncomment if you get no picture on HDMI for a default >
#hdmi_safe=1
uncomment the following to adjust overscan. Use positi>
# goes off screen, and negative if there is too much bor>
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16
uncomment to force a console size. By default it will >
# overscan.
#framebuffer_width=1280
#framebuffer_height=720
uncomment if hdmi display is not detected and composit>
#hdmi_force_hotplug=1
# uncomment to force a specific HDMI mode (this will for>
#hdmi_group=1
#hdmi_mode=1
uncomment to force a HDMI mode rather than DVI. This c>
# DMT (computer monitor) modes
#hdmi_drive=2
# uncomment to increase signal to HDMI, if you have inte>
# no display
#config_hdmi_boost=4
# uncomment for composite PAL
#sdtv_mode=2
uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800
# Uncomment some or all of these to enable the optional >
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on
Uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18
# Additional overlays and parameters are documented /boo>
Enable audio (loads snd_bcm2835)
dtparam=audio=on
# Automatically load overlays for detected cameras
camera_auto_detect=1
Automatically load overlays for detected DSI displ>
display_auto_detect=1
# Enable DRM VC4 V3D driver
#dtoverlay=vc4-kms-v3d
max_framebuffers=2
Run in 64-bit mode
arm_64bit=1
# Disable compensation for displays with overscan
disable_overscan=1
[cm4]
# Enable host mode on the 2711 built-in XHCI USB con>
# This line should be removed if the legacy DWC2 con>
# (e.g. for USB device mode) or if USB support is no>
otg_mode=1
[all]
[pi4]
# Run as fast as firmware / board allows
arm_boost=1
[all]
hdmi_force_hotplug=1
dtparam=i2c_arm=on
dtparam=spi=on
enable_uart=1
dtoverlay=mhs35:rotate=90
hdmi_group=2
hdmi_mode=1
hdmi_mode=87
hdmi_cvt 480 320 60 6 0 0 0
hdmi_drive=2
For now, the screen still doesn't rotate. Thanks to this, I always have the screen with the power cable facing down, which makes it difficult to place it normally. I checked this error by installing Raspberry Pi OS 64-bit and then 32-bit (both via Raspberry Pi Imager v1.8.5, released 2024-03-15)sudo ./rotate.sh 0
sudo reboot
)dtoverlay=mhs35:rotate=90
to remain in the config.txt file (so nothing will change)sudo ./rotate.sh 180
dtoverlay=mhs35:rotate=270
sudo ./rotate.sh 0
will once again cause the system to reset itself and the value in config.txt will return to 90./dts-v1/;
/ {
compatible = "brcm,bcm2835\0brcm,bcm2708\0brcm,bcm2709";
fragment@0 {
target = <0xdeadbeef>;
__overlay__ {
status = "okay";
spidev@0 {
status = "disabled";
};
spidev@1 {
status = "disabled";
};
};
};
fragment@1 {
target = <0xdeadbeef>;
__overlay__ {
tft35a_pins {
brcm,pins = <0x11 0x19 0x18>;
brcm,function = <0x00 0x00 0x00>;
linux,phandle = <0x01>;
phandle = <0x01>;
};
};
};
fragment@2 {
target = <0xdeadbeef>;
__overlay__ {
#address-cells = <0x01>;
#size-cells = <0x00>;
tft35a@0 {
compatible = "ilitek,ili9486";
reg = <0x00>;
pinctrl-names = "default";
pinctrl-0 = <0x01>;
spi-max-frequency = <0x6dac2c0>;
txbuflen = <0x8000>;
rotate = <0x5a>;
bgr = <0x00>;
fps = <0x1e>;
buswidth = <0x08>;
regwidth = <0x10>;
reset-gpios = <0xdeadbeef 0x19 0x01>;
dc-gpios = <0xdeadbeef 0x18 0x00>;
debug = <0x00>;
init = <0x10000f1 0x36 0x04 0x00 0x3c 0x0f 0x8f 0x10000f2 0x18 0xa3 0x12 0x02 0xb2 0x12 0xff 0x10 0x00 0x10000f8 0x21 0x04 0x10000f9 0x00 0x08 0x1000036 0x08 0x10000b4 0x00 0x10000c1 0x41 0x10000c5 0x00 0x91 0x80 0x00 0x10000e0 0x0f 0x1f 0x1c 0x0c 0x0f 0x08 0x48 0x98 0x37 0x0a 0x13 0x04 0x11 0x0d 0x00 0x10000e1 0x0f 0x32 0x2e 0x0b 0x0d 0x05 0x47 0x75 0x37 0x06 0x10 0x03 0x24 0x20 0x00 0x100003a 0x55 0x1000011 0x1000036 0x28 0x20000ff 0x1000029>;
linux,phandle = <0x02>;
phandle = <0x02>;
};
tft35a-ts@1 {
compatible = "ti,ads7846";
reg = <0x01>;
spi-max-frequency = <0x1e8480>;
interrupts = <0x11 0x02>;
interrupt-parent = <0xdeadbeef>;
pendown-gpio = <0xdeadbeef 0x11 0x01>;
ti,x-plate-ohms = [00 3c];
ti,pressure-max = [00 ff];
linux,phandle = <0x03>;
phandle = <0x03>;
};
};
};
__overrides__ {
speed = <0x02 0x7370692d 0x6d61782d 0x66726571 0x75656e63 0x793a3000>;
txbuflen = [00 00 00 02 74 78 62 75 66 6c 65 6e 3a 30 00];
rotate = [00 00 00 02 72 6f 74 61 74 65 3a 30 00];
fps = [00 00 00 02 66 70 73 3a 30 00];
bgr = [00 00 00 02 62 67 72 3a 30 00];
debug = <0x02 0x64656275 0x673a3000>;
swapxy = <0x03 0x74692c73 0x7761702d 0x78793f00>;
};
__symbols__ {
tft35a_pins = "/fragment@1/__overlay__/tft35a_pins";
tft35a = "/fragment@2/__overlay__/tft35a@0";
tft35a_ts = "/fragment@2/__overlay__/tft35a-ts@1";
};
__fixups__ {
spi0 = "/fragment@0:target:0\0/fragment@2:target:0";
gpio = "/fragment@1:target:0\0/fragment@2/__overlay__/tft35a@0:reset-gpios:0\0/fragment@2/__overlay__/tft35a@0:dc-gpios:0\0/fragment@2/__overlay__/tft35a-ts@1:interrupt-parent:0\0/fragment@2/__overlay__/tft35a-ts@1:pendown-gpio:0";
};
__local_fixups__ {
fixup = "/fragment@2/__overlay__/tft35a@0:pinctrl-0:0\0/__overrides__:speed:0\0/__overrides__:txbuflen:0\0/__overrides__:rotate:0\0/__overrides__:fps:0\0/__overrides__:bgr:0\0/__overrides__:debug:0\0/__overrides__:swapxy:0";
};
};
which basically describes the display (and touch screen) configuration.hdmi_force_hotplug=1
dtparam=i2c_arm=on
dtparam=spi=on
enable_uart=1
dtoverlay=mhs35:rotate=90
hdmi_group=2
hdmi_mode=1
hdmi_mode=87
hdmi_cvt 480 320 60 6 0 0 0
hdmi_drive=2
where you should take note of the dtoverlay=mhs35:rotate=90 line.cd ~
dtc -I dtb -O dts /boot/overlays/mhs35.dtbo mhs35.dts
sed -i -e 's|^\([ \t]*\)rotate *= *<[^>]*>|\1rotate = <0>|g' mhs35.dts
dtc -I dts -O dtb mhs35.dts mhs35.dtbo
sudo cp -f mhs35.dtbo /boot/overlays/mhs35.dtbo
sudo cp -f mhs35.dtbo /boot/overlays/mhs35-overlay.dtb
sudo chmod u=rw,go=r /boot/overlays/mhs35*.dtb*
to decompile the device tree overlay, change the rotation parameter, recompile it, and save it back. Reboot. If the display orientation changes, but isn't correct, runcd ~
sed -i -e 's|^\([ \t]*\)rotate *= *<[^>]*>|\1rotate = <180>|g' mhs35.dts
dtc -I dts -O dtb mhs35.dts mhs35.dtbo
sudo cp -f mhs35.dtbo /boot/overlays/mhs35.dtbo
sudo cp -f mhs35.dtbo /boot/overlays/mhs35-overlay.dtb
sudo chmod u=rw,go=r /boot/overlays/mhs35*.dtb*
and reboot.You could install dtc,
sudo apt install device-tree-compiler
and then runCode: [Select]cd ~
to decompile the device tree overlay, change the rotation parameter, recompile it, and save it back.
dtc -I dtb -O dts /boot/overlays/mhs35.dtbo mhs35.dts
sed -i -e 's|^\([ \t]*\)rotate *= *<[^>]*>|\1rotate = <0>|g' mhs35.dts
dtc -I dts -O dtb mhs35.dts mhs35.dtbo
sudo cp -f mhs35.dtbo /boot/overlays/mhs35.dtbo
sudo cp -f mhs35.dtbo /boot/overlays/mhs35-overlay.dtb
sudo chmod u=rw,go=r /boot/overlays/mhs35*.dtb*
Usage: dtc [options] <input file>
Options: -[qI:O:o:V:d:R:S:p:a:fb:i:H:sW:E:@AThv]
-q, --quiet
Quiet: -q suppress warnings, -qq errors, -qqq all
-I, --in-format <arg>
Input formats are:
dts - device tree source text
dtb - device tree blob
fs - /proc/device-tree style directory
-o, --out <arg>
Output file
-O, --out-format <arg>
Output formats are:
dts - device tree source text
dtb - device tree blob
yaml - device tree encoded as YAML
asm - assembler source
-V, --out-version <arg>
Blob version to produce, defaults to 17 (for dtb and asm output)
-d, --out-dependency <arg>
Output dependency file
-R, --reserve <arg>
Make space for <number> reserve map entries (for dtb and asm output)
-S, --space <arg>
Make the blob at least <bytes> long (extra space)
-p, --pad <arg>
Add padding to the blob of <bytes> long (extra space)
-a, --align <arg>
Make the blob align to the <bytes> (extra space)
-b, --boot-cpu <arg>
Set the physical boot cpu
-f, --force
Try to produce output even if the input tree has errors
-i, --include <arg>
Add a path to search for include files
-s, --sort
Sort nodes and properties before outputting (useful for comparing trees)
-H, --phandle <arg>
Valid phandle formats are:
legacy - "linux,phandle" properties only
epapr - "phandle" properties only
both - Both "linux,phandle" and "phandle" properties
-W, --warning <arg>
Enable/disable warnings (prefix with "no-")
-E, --error <arg>
Enable/disable errors (prefix with "no-")
-@, --symbols
Enable generation of symbols
-A, --auto-alias
Enable auto-alias of labels
-T, --annotate
Annotate output .dts with input source file and line (-T -T for more details)
-h, --help
Print this help and exit
-v, --version
Print version and exit
Error: missing files
even though the file mhs35.dtbo is in the Overlays folder, and has the appropriate access permissions, so it should be possible for the dtc command to process it...ls /boot/overlays
act-led.dtbo
adafruit18.dtbo
adafruit-st7735r.dtbo
adau1977-adc.dtbo
adau7002-simple.dtbo
ads1015.dtbo
ads1115.dtbo
ads7846.dtbo
adv7282m.dtbo
adv728x-m.dtbo
akkordion-iqdacplus.dtbo
allo-boss2-dac-audio.dtbo
allo-boss-dac-pcm512x-audio.dtbo
allo-digione.dtbo
allo-katana-dac-audio.dtbo
allo-piano-dac-pcm512x-audio.dtbo
allo-piano-dac-plus-pcm512x-audio.dtbo
anyspi.dtbo
apds9960.dtbo
applepi-dac.dtbo
arducam-64mp.dtbo
arducam-pivariety.dtbo
at86rf233.dtbo
audioinjector-addons.dtbo
audioinjector-bare-i2s.dtbo
audioinjector-isolated-soundcard.dtbo
audioinjector-ultra.dtbo
audioinjector-wm8731-audio.dtbo
audiosense-pi.dtbo
audremap.dtbo
balena-fin.dtbo
bcm2712d0.dtbo
camera-mux-2port.dtbo
camera-mux-4port.dtbo
cap1106.dtbo
chipdip-dac.dtbo
cirrus-wm5102.dtbo
cma.dtbo
cm-swap-i2c0.dtbo
crystalfontz-cfa050_pi_m.dtbo
cutiepi-panel.dtbo
dacberry400.dtbo
dht11.dtbo
dionaudio-kiwi.dtbo
dionaudio-loco.dtbo
dionaudio-loco-v2.dtbo
disable-bt.dtbo
disable-bt-pi5.dtbo
disable-emmc2.dtbo
disable-wifi.dtbo
disable-wifi-pi5.dtbo
dpi18cpadhi.dtbo
dpi18.dtbo
dpi24.dtbo
draws.dtbo
dwc2.dtbo
dwc-otg.dtbo
edt-ft5406.dtbo
enc28j60.dtbo
enc28j60-spi2.dtbo
exc3000.dtbo
fbtft.dtbo
fe-pi-audio.dtbo
fsm-demo.dtbo
gc9a01.dtbo
ghost-amp.dtbo
goodix.dtbo
googlevoicehat-soundcard.dtbo
gpio-charger.dtbo
gpio-fan.dtbo
gpio-hog.dtbo
gpio-ir.dtbo
gpio-ir-tx.dtbo
gpio-key.dtbo
gpio-led.dtbo
gpio-no-bank0-irq.dtbo
gpio-no-irq.dtbo
gpio-poweroff.dtbo
gpio-shutdown.dtbo
hat_map.dtb
hd44780-lcd.dtbo
hdmi-backlight-hwhack-gpio.dtbo
hifiberry-amp100.dtbo
hifiberry-amp3.dtbo
hifiberry-amp4pro.dtbo
hifiberry-amp.dtbo
hifiberry-dac8x.dtbo
hifiberry-dac.dtbo
hifiberry-dacplusadc.dtbo
hifiberry-dacplusadcpro.dtbo
hifiberry-dacplusdsp.dtbo
hifiberry-dacplus.dtbo
hifiberry-dacplushd.dtbo
hifiberry-digi.dtbo
hifiberry-digi-pro.dtbo
highperi.dtbo
hy28a.dtbo
hy28b-2017.dtbo
hy28b.dtbo
i2c0.dtbo
i2c0-pi5.dtbo
i2c1.dtbo
i2c1-pi5.dtbo
i2c2-pi5.dtbo
i2c3.dtbo
i2c3-pi5.dtbo
i2c4.dtbo
i2c5.dtbo
i2c6.dtbo
i2c-bcm2708.dtbo
i2c-fan.dtbo
i2c-gpio.dtbo
i2c-mux.dtbo
i2c-pwm-pca9685a.dtbo
i2c-rtc.dtbo
i2c-rtc-gpio.dtbo
i2c-sensor.dtbo
i2s-dac.dtbo
i2s-gpio28-31.dtbo
ilitek251x.dtbo
imx219.dtbo
imx258.dtbo
imx290.dtbo
imx296.dtbo
imx327.dtbo
imx378.dtbo
imx462.dtbo
imx477.dtbo
imx519.dtbo
imx708.dtbo
interludeaudio-analog.dtbo
interludeaudio-digital.dtbo
iqaudio-codec.dtbo
iqaudio-dac.dtbo
iqaudio-dacplus.dtbo
iqaudio-digi-wm8804-audio.dtbo
iqs550.dtbo
irs1125.dtbo
i-sabre-q2m.dtbo
jedec-spi-nor.dtbo
justboom-both.dtbo
justboom-dac.dtbo
justboom-digi.dtbo
ltc294x.dtbo
max98357a.dtbo
maxtherm.dtbo
mbed-dac.dtbo
mcp23017.dtbo
mcp23s17.dtbo
mcp2515-can0.dtbo
mcp2515-can1.dtbo
mcp2515.dtbo
mcp251xfd.dtbo
mcp3008.dtbo
mcp3202.dtbo
mcp342x.dtbo
media-center.dtbo
merus-amp.dtbo
mhs35.dtbo
mhs35.dts
mhs35-overlay.dtb
midi-uart0.dtbo
midi-uart0-pi5.dtbo
midi-uart1.dtbo
midi-uart1-pi5.dtbo
midi-uart2.dtbo
midi-uart2-pi5.dtbo
midi-uart3.dtbo
midi-uart3-pi5.dtbo
midi-uart4.dtbo
midi-uart4-pi5.dtbo
midi-uart5.dtbo
minipitft13.dtbo
miniuart-bt.dtbo
mipi-dbi-spi.dtbo
mlx90640.dtbo
mmc.dtbo
mz61581.dtbo
ov2311.dtbo
ov5647.dtbo
ov64a40.dtbo
ov7251.dtbo
ov9281.dtbo
overlay_map.dtb
papirus.dtbo
pca953x.dtbo
pcf857x.dtbo
pcie-32bit-dma.dtbo
pcie-32bit-dma-pi5.dtbo
pibell.dtbo
pifacedigital.dtbo
pifi-40.dtbo
pifi-dac-hd.dtbo
pifi-dac-zero.dtbo
pifi-mini-210.dtbo
piglow.dtbo
piscreen2r.dtbo
piscreen.dtbo
pisound.dtbo
pisound-pi5.dtbo
pitft22.dtbo
pitft28-capacitive.dtbo
pitft28-resistive.dtbo
pitft35-resistive.dtbo
pps-gpio.dtbo
proto-codec.dtbo
pwm1.dtbo
pwm-2chan.dtbo
pwm.dtbo
pwm-ir-tx.dtbo
qca7000.dtbo
qca7000-uart0.dtbo
ramoops.dtbo
ramoops-pi4.dtbo
README
rotary-encoder.dtbo
rpi-backlight.dtbo
rpi-codeczero.dtbo
rpi-dacplus.dtbo
rpi-dacpro.dtbo
rpi-digiampplus.dtbo
rpi-ft5406.dtbo
rpi-poe.dtbo
rpi-poe-plus.dtbo
rpi-sense.dtbo
rpi-sense-v2.dtbo
rpi-tv.dtbo
rra-digidac1-wm8741-audio.dtbo
sainsmart18.dtbo
sc16is750-i2c.dtbo
sc16is752-i2c.dtbo
sc16is752-spi0.dtbo
sc16is752-spi1.dtbo
sdhost.dtbo
sdio.dtbo
sdio-pi5.dtbo
seeed-can-fd-hat-v1.dtbo
seeed-can-fd-hat-v2.dtbo
sh1106-spi.dtbo
si446x-spi0.dtbo
smi-dev.dtbo
smi.dtbo
smi-nand.dtbo
spi0-0cs.dtbo
spi0-1cs.dtbo
spi0-2cs.dtbo
spi1-1cs.dtbo
spi1-2cs.dtbo
spi1-3cs.dtbo
spi2-1cs.dtbo
spi2-1cs-pi5.dtbo
spi2-2cs.dtbo
spi2-2cs-pi5.dtbo
spi2-3cs.dtbo
spi3-1cs.dtbo
spi3-1cs-pi5.dtbo
spi3-2cs.dtbo
spi3-2cs-pi5.dtbo
spi4-1cs.dtbo
spi4-2cs.dtbo
spi5-1cs.dtbo
spi5-1cs-pi5.dtbo
spi5-2cs.dtbo
spi5-2cs-pi5.dtbo
spi6-1cs.dtbo
spi6-2cs.dtbo
spi-gpio35-39.dtbo
spi-gpio40-45.dtbo
spi-rtc.dtbo
ssd1306.dtbo
ssd1306-spi.dtbo
ssd1331-spi.dtbo
ssd1351-spi.dtbo
superaudioboard.dtbo
sx150x.dtbo
tc358743-audio.dtbo
tc358743.dtbo
tinylcd35.dtbo
tpm-slb9670.dtbo
tpm-slb9673.dtbo
uart0.dtbo
uart0-pi5.dtbo
uart1.dtbo
uart1-pi5.dtbo
uart2.dtbo
uart2-pi5.dtbo
uart3.dtbo
uart3-pi5.dtbo
uart4.dtbo
uart4-pi5.dtbo
uart5.dtbo
udrc.dtbo
ugreen-dabboard.dtbo
upstream.dtbo
upstream-pi4.dtbo
vc4-fkms-v3d.dtbo
vc4-fkms-v3d-pi4.dtbo
vc4-kms-dpi-generic.dtbo
vc4-kms-dpi-hyperpixel2r.dtbo
vc4-kms-dpi-hyperpixel4.dtbo
vc4-kms-dpi-hyperpixel4sq.dtbo
vc4-kms-dpi-panel.dtbo
vc4-kms-dsi-7inch.dtbo
vc4-kms-dsi-generic.dtbo
vc4-kms-dsi-lt070me05000.dtbo
vc4-kms-dsi-lt070me05000-v2.dtbo
vc4-kms-dsi-waveshare-panel.dtbo
vc4-kms-kippah-7inch.dtbo
vc4-kms-v3d.dtbo
vc4-kms-v3d-pi4.dtbo
vc4-kms-v3d-pi5.dtbo
vc4-kms-vga666.dtbo
vga666.dtbo
vl805.dtbo
w1-gpio.dtbo
w1-gpio-pi5.dtbo
w1-gpio-pullup.dtbo
w1-gpio-pullup-pi5.dtbo
w5500.dtbo
watterott-display.dtbo
waveshare-can-fd-hat-mode-a.dtbo
waveshare-can-fd-hat-mode-b.dtbo
wittypi.dtbo
wm8960-soundcard.dtbo
Edited to add: Also, if you run a 5.4 or newer kernel, then you might be using TINYDRM_ILI9486 (ili9486) DRM driver instead (which is a much better solution anyway). So, do check your kernel version (uname -r or cat /proc/version), too.
config.txt, cmdline.txt and overlays folder are moved from /boot/ to /boot/firmware/ with some update for 6.* kernel.
So, the proper way is to edit /boot/firmware/config.txt instead of /boot/config.txt
if you edit /boot/config.txt it won't have effect.
Did you take this into account?