A recent update to Raspian has caused the Raspberry Pi 7″ LCD touch screen to display upside down. For some users, this might not be an issue, as you might be able to physically flip your screen so it displays the right way up. However, if you have your touch screen mounted in a frame, this will not be an option, so here is an alternative way to get your screen to display correctly.
The solution to the problem of the inverted Raspberry Pi 7” LCD touch screen may vary, depending on your particular setup.
For Raspbian or for the most recent release of NOOBS (1.4.2), the solution is generally very straightforward, and simply involves adding the line:-
to the bottom of the configuration file /boot/config.txt.
To edit this configuration file, use the command:-
sudo nano /boot/config.txt
This solution may also work for older versions of NOOBS. However, there have been situations, when running NOOBS, where modifying the config.txt file directly has not worked, so a slightly more involved solution is required.
If the solution described previously does not work, then it will be necessary to enter NOOBS recovery mode while booting the Pi (Note, that it may be necessary to conect the Pi to a separate HDMI monitor to to this, as during boot the Pi may default to the HDMI display instead of the LCD display). To enter NOOBS recover mode, hold down the shift key while powering on the Pi. This should cause the Pi to enter NOOBS recovery mode, resulting in a screen similar to that below:-
The Edit config (e) option should be enabled. Select this option, and make the necessary changes to the configuration file config.txt.
As with Raspbian, it is necessary to add the line:-
to the bottom of this configuration file. Having made this change to the configuration file, press OK to save the changes, and exit recovery mode and allow the Pi to reboot.
It is possible that the Pi does not enter NOOBS recovery mode when powered up with the shift key depressed. If this happens, it may be necessary to update the NOOBS bootfiles. To do this it will be necessary to access the FAT recovery partition from a Windows PC, and copy the following files to this FAT recovery partition on the SD card (where necessary, overwriting the existing files):-
Having copied these files, rename start.elf to recovery.elf (again, overwriting the existing file).
Having copied these files, eject the card and put it back into the Pi. Rebooting the Pi while holding the shift key should now cause the Pi to enter NOOBS recovery mode, and thus allow the configuration file to be modified as described previously.