1

Problem

I am attempting to install the drivers for this Waveshare 4inch LCD (A) touchscreen; however, after I have installed the drivers and reboot I receive the error (displayed in the HDMI monitor, not the touchscreen):

PANIC: VFS: Unable to mount root fs on unknown-block(179,2)

I am using the latest version of Raspbian (have had to reinstall three times) on Raspberry Pi 2 B.

Guide 1

At first I followed the guide on the Waveshare wiki (I used Method 1 as I did not want to install the disk image supplied on the DVD), in summary:

1) Configure RPi to auto login 2) Download and extract the driver:

wget http://www.waveshare.com/w/upload/4/4b/LCD-show-161112.tar.gz
tar xvf LCD-show-161112.tar.gz

3) Set the RPi to use the LCD display:

./LCD4-show

The system then reboots, however I get the following error message (displayed on the HDMI monitor plugged into the RPi:

PANIC: VFS: Unable to mount root fs on unknown-block(179,2)

I followed this answer on StackExchange editing the cmd.txt file but the problem persists (still boots up with the same error).

Guide 2

My only option was to reinstall Raspbian. I then used this answer on StackExchange which directed me to a guide to install a different set of drivers as follows:

1) Make the RPi to output the display to the SPI bus by editing the 99-turbo.conf file, changing /dev/fb0 to /dev/fb1:

sudo nano /usr/share/X11/xorg.conf.d/99-fbturbo.conf

2) Enable SPI automatic loading under advanced options in raspi-config, then reboot.

3) Download and install the drivers and reboot:

sudo REPO_URI=https://github.com/notro/rpi-firmware rpi-update

4) After reboot configure the /etc/modules and add the following:

spi-bcm2708

fbtft_device name=waveshare32b gpios=dc:22,reset:27 speed=48000000

waveshare32b width=320 height=240 buswidth=8 init=-1,0xCB,0x39,0x2C,0x00,0x34,0x02,-1,0xCF,0x00,0XC1,0X30,-1,0xE8,0x85,0x00,0x78,-1,0xEA,0x00,0x00,-1,0xED,0x64,0x03,0X12,0X81,-1,0xF7,0x20,-1,0xC0,0x23,-1,0xC1,0x10,-1,0xC5,0x3e,0x28,-1,0xC7,0x86,-1,0x36,0x28,-1,0x3A,0x55,-1,0xB1,0x00,0x18,-1,0xB6,0x08,0x82,0x27,-1,0xF2,0x00,-1,0x26,0x01,-1,0xE0,0x0F,0x31,0x2B,0x0C,0x0E,0x08,0x4E,0xF1,0x37,0x07,0x10,0x03,0x0E,0x09,0x00,-1,0XE1,0x00,0x0E,0x14,0x03,0x11,0x07,0x31,0xC1,0x48,0x08,0x0F,0x0C,0x31,0x36,0x0F,-1,0x11,-2,120,-1,0x29,-1,0x2c,-3

ads7846_device model=7846 cs=1 gpio_pendown=17 speed=1000000 keep_vref_on=1 swap_xy=0 pressure_max=255 x_plate_ohms=60 x_min=200 x_max=3900 y_min=200 y_max=3900

At this point I will note that there isn't a specific driver for the Waveshare 4inch LCD screen on here; however, the user who link the aforementioned guide stated he got his screen to work using the driver for flexfb.

In the above text I change waveshare32b with flexfb.

5) Next I edit the /boot/cmdline.txt file (I comment out the current cmdline text) and add:

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait fbtft_device.custom fbtft_device.name=waveshare32b fbtft_device.gpios=dc:22,reset:27 fbtft_device.bgr=1 fbtft_device.speed=48000000 fbcon=map:10 fbcon=font:ProFont6x11 logo.nologo dma.dmachans=0x7f35 console=tty1 consoleblank=0 fbtft_device.fps=50 fbtft_device.rotate=0

Also, I swap waveshare32b for flexfb.

6) Finally, I set the RPi to load startx to boot automatically to the GUI with sudo nano /etc/rc.local and adding:

su -l pi -c startx

I then set raspi-config to automatically login to the desktop.

After all of this the RPi boots up but the HDMI monitor gives exactly the same error message:

PANIC: VFS: Unable to mount root fs on unknown-block(179,2)

Which is not healed by fixing the cmdline.txt file in recovery.

Questions

What am I doing something wrong? Does anyone have any suggestions for installing drivers to avoid this error? Or suggestions to fix the problem behind this error?

Any assistance is greatly appreciated!

Deleuze
  • 236
  • 2
  • 10
  • 1
    `PANIC: VFS: Unable to mount root fs on unknown-block(179,2)` means the root filesystem isn't clean and can't be mounted. You need to `fsck` it. Easiest way to do that is be temporarily mounting it on another Linux system (your RPi booted from another SDCard) and running `sudo umount /dev/sdb2; sudo fsck -f -y /dev/sdb2`. – Dougie Apr 29 '20 at 00:04

2 Answers2

1

Have you tried this on other linux PC after inserting SD card?

e2fsck -f -v /dev/mmcblk0p2

It seems your file system has been corrupted and needs to be checked.Refer to this link

Sean83
  • 201
  • 2
  • 8
  • Thanks Sean83, I get the following message: e2fsck: Attempt to read block from filesystem resulted in short read while while trying to open /dev/mmcblk0p2 Could this be a zero-length partition? No usbs plugged in except keyboard. – Deleuze Nov 20 '16 at 15:46
  • What is the output for this? sudo file -sL /dev/mmcblk* – Sean83 Nov 20 '16 at 17:02
  • sudo file -sL /dev/mmcblk* – Sean83 Nov 20 '16 at 17:03
1

This is what I followed to get mine working:

  1. use this /boot/cmdline.txt:

    dwc_otg.lpm_enable=0 console=tty1 console=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait fbcon=map:10 fbcon=font:ProFont6x11     logo.nologo
    
  2. edit the end of /boot/config.txt to contain:

    dtparam=audio=on
    dtparam=spi=on
    dtoverlay=ads7846,penirq=25,penirq_pull=2,xohms=150,swapxy=1,xmin=300,ymin=700,xmax=3800,ymax=3400,pmax=255
    dtoverlay=waveshare35a
    
  3. copy waveshare35a.dtb (found on-line via swkim01's waveshare git hub [use a web search]) to the /boot/overlays directory as:

    waveshare35a.dtbo
    

(note that the new kernel requires a '.dtbo' on overlays now!)

  1. edit /usr/share/X11/xorg.conf.d/99-fbturbo.conf to contain:

    Section "Device"
    Identifier "Allwinner A10/A13 FBDEV"
    Driver "fbturbo"
    Option "fbdev" "/dev/fb1"
    Option "SwapbuffersWait" "true"
    EndSection
    
  2. create a file named 99-calibration.conf under /etc/X11/xorg.conf.d to contain:

    Section "InputClass"
    Identifier "calibration"
    MatchProduct "ADS7846 Touchscreen"
    Option "Calibration" "3932 300 294 3801"
    Option "SwapAxes" "1"
    EndSection
    
  3. reboot and enjoy!

credits to willie from : kg4zqz.blogspot.com

Brett Reinhard
  • 434
  • 1
  • 4
  • 13
  • Hmmm, thanks again - still having the issue with the file system being corrupted... – Deleuze Nov 27 '16 at 19:49
  • @Deleuze how are you managing shutdown , and what class sd card are you using ? – Brett Reinhard Nov 27 '16 at 20:12
  • Thanks Brett, class 4 Samsung SD card - works fine when I run Raspbian without the touchscreen drivers installed. When installing drivers am using sudo reboot, once the file system is corrupted all I can do is oull the plug and eventually reinstall the OS. – Deleuze Nov 28 '16 at 14:46
  • Two things, when you first install the OS do you use sudo raspi-config and expand the filesystem. If you do I would suggest looking into making your system a read only system if what you are using your pi for will allow for such a setup. @Deleuze – Brett Reinhard Nov 28 '16 at 15:09
  • Thanks Brett - I will have a look at making the system read only and see if that helps. – Deleuze Nov 28 '16 at 15:17