Setting up TonTec 3.5 Inch TFT using the fbtft driver

This is a follow up post to my other page describing how I managed to get the Tontec 3.5 inch TFT to work using a modified fbtft driver. Now my changes have been accepted to the fbtft project it is simpler to use the kernel provided Notro. These instructions are for the Raspbian distribution for the Raspberry Pi.

Step 1 – Install Raspbain

I will not cover this step as there are plenty of other sites offering tutorials about this. Just google for “install Raspbian”.

Step 2 – Update the system

Before you install the fbtft drivers it is wise to update the system. This step needs to be performed on the Raspberry Pi from a terminal window (or ssh from a remote computer).

Step 3 – Install fbtft kernel and modules

This step will install the latest kernel including the fbtft drivers and modules. Again from a terminal window issue the following command.

Step 4 – Configure the driver

In this step we will need to edit some files. The easiest editor on the command line is “nano”. The files we will be editing are as follows:

  • /etc/modprobe.d/raspi-blacklist.conf – Used to prevent modules from loading
  • /etc/modules – Used to load modules at boot time
  • /boot/cmdline.txt – Used to customise kernel driver options during boot.

First we will edit raspi-blacklist.conf. We need to prevent this from blacklisting “spi-bcm2708” as this is a dependency for fbtft. So type the following command in the terminal window.

File before editing:

Then change the file to look like this:

Save and exit nano using “ctrl+x” then press ‘y’. Next we need to edit /etc/modules. Before editing this file you need to know which TonTec display you have. There are currently 2 different models available. You can find this printed on the back of the LCD PCB.

  • WZ9486-Pi-EXT -> use name=tontec35_9486 for fbtft_device option
  • WZ9481-Pi-EXT -> use name=tontec35_9481 for the fctft_device option

File contents before editing:

Edit the file to look like this (remember to set the correct name=* option for your display. The rotate option can be 0, 90, 180 or 270. If not specified it will default to 0):

Once you have changed the file save and exit nano. Finally we will add a new parameter to /boot/cmdline.txt. This new option will tell the kernel to map the console output to frame buffer 1 (/dev/fb1).

File contents before editing:

Edit the file to look like this (remember that it one line and may be wrapper in your editor):

Ok you should now be able to test the changes. Save the file and exit nano. Then reboot the Raspberry Pi.

When the Raspberry Pi reboots you should now see the console messages being printed on the display.

Step 5 – Configure X to use /dev/fb1

In this step we will configure X to use /dev/fb1. First we need to install the frame buffer drivers for X.

Next we need to create a new config file for X.

Once nano has started enter the following details:

Save and exit nano (“ctrl+x” followed by ‘y’). Now try and start X using the following command:

Step 6 – Configure the touch screen drivers

Now you should have X running on your LCD. Next we will configure the ads7846 device. First we need to configure the ads7846 driver module. This is done using the ads7846_device helper module through the /etc/modules file. Open this file for editing using nano.

File contents before editing:

Change the file to look like this:

Once you have edited the file save and exit nano. Next you need to install some additional tools for accessing the touch screen from X. Issue the following command in the terminal window.

Finally you need to create a new touch screen calibration config file for X. Create the file with the following command:

Enter the following details into the file:

Save and exit nano. We now need to reboot the Raspberry Pi for the driver settings at the beginning of this step to take effect.

Once the Raspberry Pi has rebooted you can startx from the command line. The touch screen should now work as a mouse pointer.


  • Notro – for the excellent fbtft driver and providing pre-built kernels.
  • Greg – for the information related to X fbdev settings posted in the comments on my other page.
  • Minde – for the information related to X ADS7846 Touchscreen settings also posted in the comments on my other page.


Setting up TonTec 3.5 Inch TFT using the fbtft driver — 105 Comments

  1. Thanks for your great instruction, I have a different lcd with ILI9486 chip (see ebay: and with a few modification I could get it to function. Perhaps interesting for other users here my modifications for this lcd (without adjustment of speed you will get wrong colors):
    fbtft_device name=piscreen rotate=90 speed=16000000
    ads7846_device cs=1 speed=2000000 model=7846 pressure_max=255 y_min=190 y_max=3850 gpio_pendown=17 x_max=3850 x_min=230 x_plate_ohms=60

    Section “InputClass”
    Identifier “calibration”
    MatchProduct “ADS7846 Touchscreen”
    Option “Calibration” “3911 275 157 3950”

  2. Hi Jon,
    I am new to the pi and the tontec display. I have tried a number of drivers (including the one suggested by the manufacturer) so far your version of the notro one is the most successful.
    I am trying to get it to work with Retropie (which Im beginning to think is the man issue)
    I am struggling to get the display to work in console, I have followed your instructions but still no joy (again im assuming this is because im using retropie) I can get the display to display x but it gets a bit distorted and crashes etc. Should I change the resolution (currently using 960/640) as it is a recent display (9486 model) should I be using a lower res? Cheers in advance


    • Hi Pete,

      I am glad you have had some success with the driver. I don’t have any experience with retropie but from what I have read its based on raspbian. Regarding the console: Have you added the parameters in /boot/cmdline.txt? If you are trying to run an emulator you might need to tell the emulator which framebuffer (/dev/fb1) to use. Assuming the emulator is using the SDL framework you could try running this command “export SDL_FBDEV=/dev/fb1” before running the emulator.
      As for the resolution, I think 960×640 is a little to high for the display. In the fbtft driver the maximum resolution is 480×320 for this display. Running any higher than this will result in down scaling which is why it is probably distorted.

      I hope that helps.

      • Hi Jon, cheers for the speedy reply 🙂
        I forgot to mention that this is a great blog/page! Your reply is much more positive than I expected, I was waiting to hear that this type of screen is not appropiate for this use lol. I will give your suggestion a try and report back any findings just in case there are others trying to do a similar project. I’m trying to make a little portable using an old game-gear case, and will paint in the same colours as the titanfall xbox controllers so if it ever works it should look pretty neat 🙂
        Cheers again for the advice 😀

        • Sorry also forgot to answer your question, yes I have added the /boot/cmdline parameters. It worked initially very briefly as I exited x and then stopped working after reboot. Hopefully this is also related to the res settings. I will post back with any results. Cheers again 🙂

  3. Jon,
    I just want to thank you for your hard work on this project. Everything is working great including the touch screen in x. I don’t think I would have gotten to this point without the information and kernel that you posted.
    Thanks so much!

  4. Hi Jon,
    Just got the Tontec 3.5 LCD for my birthday.
    I’ve been using a Raspberry Pi to control my Central Heating using my own code for a few years now but would not have had the expertise to go into driver stuff for my new LCD.
    Your explanation and instructions are spot on. Thank you.
    I now have the starting point to hopefully show the pictures from another Pi on the network being used with a noir camera in a security setup.

    One question, how can I easily temporarily change the resolution of the LCD so it will accept 960 x 480 which Tontec say it should be able to run with? I’m finding the standard resolution does not show the bottom of some of the X setup windows and so can’t see the whole of the wifi setup screen correctly. If that isn’t possible how do I switch the X server back to the HDMI output so I can setup the WIFI then change it back to the LCD when done? I do know I can also do it via the command line and edit the WPA files but want to play a bit 🙂

    • Hi David,

      I don’t think it is possible to run the display in 960×480. The screen itself only supports 480×320. To run at higher resolutions would require some kind of software down scaling which would result in bad quality video. So you have several options:
      1) if you have a keyboard + mouse connected you can hold the Alt key and click and hold the left mouse button on an area of the dialog box and move it up the screen to reveal the area you cannot see.
      2) Configure from command line (as you suggested)
      3) change back to HDMI. To do this rename or move “/usr/share/X11/xorg.conf.d/99-fbdev.conf”.
      sudo mv /usr/share/X11/xorg.conf.d/99-fbdev.conf ~/
      sudo reboot

      After to reinstate the LCD
      sudo mv ~/99-fbdev.conf /usr/share/X11/xorg.conf.d/
      sudo reboot

      I hope that helps.



  5. Hi, i keep getting stuck after I modify the new parameter to /boot/cmdline.txt. when I reboot the os never boots up all the way. and the screen doesnt display anything(only HDMI still works). I have the ILI9486 screen. is there some steps I am missing before I try to install the modules and drivers.
    I know other people are having success with getting it to work so it must be a lack of my understanding in programing.
    Any help would be apreciated.
    Thanks, Chris

    • Hi Chris,

      The main thing to remember about /boot/cmdline.txt is that it all needs to be on one line. If you have a new line character in it then the kernel will not pickup anything on the new lines. So first check that. If still no screen check that you have spi-bcm2708 line commented out (prefix the line with a # character) in the “/etc/modprobe.d/raspi-blacklist.conf” file. Also check that /etc/modules includes “fbtft_device name=tontec35_9486 rotate=90”.

      If still no joy then send me the output of the following commands:-
      1) uname -a
      2) lsmod
      3) dmesg



      • Hi, Jon
        Thanks for the help, I loaded a fresh Raspbian from on a new memory card, went through all the steps again, and everything works great! just one question, say I rotate the screen to 270, where would i flip the touch for the same rotation?
        Thanks, Chris

  6. Brilliant, I’ll have a go when I get in.
    One other question is there a way to have both the LCD and the HDMI enabled together. Wih different sessions running in both, a bit like you can do with the VNC option where you can bring up another X screen on the VNC remote link while still having it on the HDMI output?

    I’ll try installing VNC/RDP and see if I can have 2 seperate sessions running.
    Thanks again. It’s a great little screen.
    I keep thinking of questions while typing. Have you tried to interface to the ON/OFF connections on the side of the screen?

    • Hi David,

      Yes it should be possible to run the HDMI and LCD together (not tried my self), however due to the limited amount of RAM on the Pi it might not be very usable. The On/Off switch just connects to a GPIO pin. So you can probably access that using WiringPi or some other library for accessing GPIO pins. I have also not tried it myself.



  7. Hi Jon,
    The wifi setup window showing on the LCD can be moved up by holding down the ALT key on the keyboard and pressing on the LCD screen over the dialog box, then moving the whole window up. So you don’t need a mouse connected. 🙂 Thanks for the tip. Wifi is now working.

    I’m finding the touch screen doesn’t go to the very right of the screen so I can’t move the scroll bar up and down if it is on the very right of the screen. I’m hoping it isn’t a hardware problem but more the driver is being told that the right hand edge stops earlier than it actually does. Is the setup for this in the modules file or the calibration file? Both have x and y MAX settings.

    • Hi David,

      I have not spent any time looking at the this but you can try several things.
      1) Tweak the settings in /etc/modules for the touch driver.
      2) use xinput_calibrator (you will need to build from source)

      Here is how you can build it on the Pi

      Update /usr/share/X11/xorg.conf.d/99-calibration.conf with the settings reported.



  8. hi Jon
    I have a JBtek 3.5 TFT I followed the instructions till i modified the cmdline.txt at first it wouldn’t let me save modification by getting error access denied then I used sudo bash and i was able to do it. Then when i reboot it the back lights on the LCD comes on but still blank the my TV freeze where i can’t do anything. What you think needs to be adjusted to move over to the next step.


    • Hi Mike,

      That sounds strange. Double check your /boot/cmdline.txt to make sure the line is not broken and that there are spaces in the correct place. You should be able to edit the file on your PC if your Pi won’t work. It seems that the driver has loaded correctly though because the LCD backlight has come on.

      The cmdline file should look like this (without the quotes):
      “dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fbcon=map:10 rootwait”



      • Jon
        The LCD still not coming on so I used Putty to continue with your steps and i got stock at startX line. Below is the response I would really appreciate it if you could take a look at it
        pi@raspberrypi ~ $ startx

        X.Org X Server 1.12.4
        Release Date: 2012-08-27
        X Protocol Version 11, Revision 0
        Build Operating System: Linux 3.2.0-2-mx5 armv7l Debian
        Current Operating System: Linux raspberrypi 3.12.34+ #1 PREEMPT Sun Dec 7 22:39: 06 CET 2014 armv6l
        Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=656 bcm2708_fb.fbhei ght=416 bcm2708.boardrev=0xe bcm2708.serial=0x38ce9cda smsc95xx.macaddr=B8:27:EB :CE:9C:DA bcm2708_fb.fbswap=1 sdhci-bcm2708.emmc_clock_freq=250000000 vc_mem.mem _base=0x1ec00000 vc_mem.mem_size=0x20000000 dwc_otg.lpm_enable=0 console=ttyAMA 0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fbco n=map:10 rootwait
        Build Date: 10 December 2014 09:32:00PM
        xorg-server 2:1.12.4-6+deb7u5 (Moritz Muehlenhoff )
        Current version of pixman: 0.33.1
        Before reporting problems, check
        to make sure that you have the latest version.
        Markers: (–) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
        (==) Log file: “/var/log/Xorg.0.log”, Time: Sun Jan 11 20:17:47 2015
        (==) Using system config directory “/usr/share/X11/xorg.conf.d”
        The XKEYBOARD keymap compiler (xkbcomp) reports:
        > Warning: Type “ONE_LEVEL” has 1 levels, but has 2 symbols
        > Ignoring extra symbols
        > Warning: Type “ONE_LEVEL” has 1 levels, but has 2 symbols
        > Ignoring extra symbols
        Errors from xkbcomp are not fatal to the X server
        ^Cxinit: connection to X server lost

        waiting for X server to shut down Server terminated successfully (0). Closing log file.

        xinit: unexpected signal 2

    • I had the same problem with the same display (from amazon).
      TO fix it, I used raspi-config in the advanced menu and enabled SPI. I also allowed it to start the modules (two questions after enabling SPI).

  9. Hi Jon,
    The xinput_calibrator does the job nicely. I still can’t get right to the righthand side but near enough for the scroll bars now to work.

    The Modules file now has:-

    fbtft_device name=tontec35_9486 rotate=90 speed=16000000
    ads7846_device cs=1 speed=2000000 model=7846 pressure_max=255 y_min=0 swap_xy=1 y_max=4095 gpio_pendown=4 x_max=4095 x_min=0 x_plate_ohms=60

    and the calibration file has:-

    Section “InputClass”
    Identifier “calibration”
    MatchProduct “ADS7846 Touchscreen”
    Option “Calibration” “3964 88 3913 136”
    Option “SwapAxes” “1”

    Thanks again, now to use it for something useful.

  10. Hello again Jon.

    Tried this, but when it comes to loading the fbtft module at boot it hangs. Might have something to do with the model, I have neither the 9486 or the 9481 apparently. The full model number of the screen I have is WZJD35H-Pi-EXT. If it helps, I used ‘tontec35_9486’ as the device name, and it seems to hang in console 2 lines after ‘SPI devices registered’.

    Will try again with the other once I reinstall raspbian.

    Thanks again.

    • Hi Sean, i am not sure that either of the drivers will work with that display. There is a 3rd screen made by tontec, i don’t have any data on these though. If you have a link to the tontec drivers then i can take a look at the see if I can work anything out.
      Also take a look at this site


      • Thanks for getting back to me so quickly.

        Date on board is exactly ‘2014.7.2’, which if that article is anything to go by then I need to use 9481, not 9486. Will get back to you once I get a chance to try it.

        • Nope, same outcome.

          The only driver I ever got from Tontec was, supplied in from the amazon page I got it from.

          That’s unfortunately the only other information I know that I have. I’ll have to contact Tontec about any other information related to the specific model.

  11. Thanks for the info on your site. For anyone interested- tontec mz61581-pi-ext dated 2014.12.28. Read info on this site and davestechmusings. Read through files and driver code from to get your head around things, took me 5-6 days! Use raspbian image from rip website, not from tontec link, is rubbish, doesn’t work and runs cpu at 100 per cent!! Go to and read through steps including gcc version check link

  12. Sorry didn’t finish. Use code from posted by ttmz to edit existing fb_ili9486.c driver or create new driver from development link. If you edit fb_ili9486 driver it is only the 0x00, 0xA0 etc data that needs changing, don’t change all code by copy and paste, just edit and leave rest as is, do not change drivername or module alias. Create new driver is bit more work and needs more reading and understanding! Am not new to this stuff but not experienced either, but I managed it. If it doesn’t work wipe sd card, re-image and try again, I had to, more than once! When you get consule to display on tontec follow steps 5 and 6 from this site to configure x and touch screen. Thanks for doing this site, helped a lot. Virtual keyboard, battery and GPS module next

  13. WANTED: How to install the third edition of Tontec TFT device for Pi.

    ISSUE: “Tontec 3.5 changed again…” –

    SUMMARY: The Tontec 3.5″ 2015 Edition Touch Screen released. If you ordered during December of 2014, you most likely recieved their latest production model dated “12-28-14”.
    The third model, the “2015 Edition”, currently has no FBTFT device driver support.

    MODEL: Tontec 3.5″ 2015 Edition (‘tontec35_9486’)
    [fb_ili9486 frame buffer, 480×320, 300 KiB video memory, 4 KiB DMA buffer memory, fps=20, spi0.0 at 128 MHz]

    TROUBLE: During boot process the screen will init with a black screen then transitions to a white-out.


    (A) How to install support for this new model?

    (B) Can you use the old base driver and pass it the new “init data” ?

    Accordingly, here is the hexadecimal init data for this new driver:


    (C) Can you start with a normal distro of Raspian or do you need to download a modified kernel from the manufacturer’s support site?


    I downloaded the custom distro (mz9486-20150107.rar) which I was told supports this NEWEST device (distro dated 1/7/2o15), but I could not get it to work during boot.

    Then I compiled the “MZL350I-PI-EXT LCD Display Module” (mzl350i-pi-ext.rar) and executed the “lcd” test file which finally turned on my screen and displayed the terminal screen, but I could not get this to reproduce on boot…

    • Hi Shawn,

      Thanks for your post. According to the post these new displays are slightly different to the ili9486 and ili9481 devices. The GPIOs seam to be mapped the same though.

      To answer your questions:
      A) This will require you building a custom kernel.
      b) You can use the other drivers code base and change the init params. But A) still applies.
      C) You can use a normal Raspbian distro to build your own kernel but this is a long process (I hear 12+ hours building). Your better off doing it on a PC (or virtual machine) running Linux.

      What are the numbers printed on the back of the LCD PCB? Ideally we need to trace it back to a datasheet that gives all the register details of the display. That way a driver can be created with correct naming.



    • Hi Shawn,

      I have created a patch for the fbtft code based on issue222:

      I have also created a kernel for you to try out. You can install it with the following instructions:

      Let me know if it works successfully.



  14. Hi Jon,

    I also have the newest tontec 3.5″ screen. (MZ61581-PI-EXT 2014.12.28).

    Tried your fbtft-kernel-03.tgz, but didn´t get it to work. Raspberry does not boot after installing. 🙁

    Can u give some instructions how to apply your patch (fbtft_add-support-for-r61581.patch)? I am newbie in linux & this screen is driving me crazy 😀

    • Hi Anti,

      I noticed I made a mistake in my instructions for fbtft-kernel-0.3.tgz.

      1) To get the original kernel to boot take the SD card out and put it into your PC.
      2) Open config.txt in a text editor and remove the “kernel=kernel-cooljc.img” line.
      3) save the file and safely remove the SD card from your PC.
      4) Put the SD card back into your Pi.
      5) Power on. Hopefully the Pi should now start backup again.

      The problem with my instructions was at the “unpack new kernel” stage. The should of read:

      The important part was “-C /”. This tells tar to change to the / directory before unpacking.

      Once you have unpacked the kernel check to make sure kernel-cooljc.img exists in /boot/



    • Hi Anti,

      Thank you for letting me know. I will submit my patch to fbtft project so that it gets included in the official code.



  15. hi,
    i have a waveshare 3.2″ Rpi LCD v4
    How can i make it work on the raspberry pi b+
    It is display connected to the pi’s gpio pins. How to install the display driver ?
    pls help..

      • Thanks jon.. i’m working on it..
        But a doubt.. i do have an image file with which the display works smoothly.. can i by anyway extract the kernel for the display (display driver) and wrige it into my customized image.??
        Both are raspbian images

        • Hi Akhil,

          Yes it is possible to extract the kernel from another image. The easiest way is to put the image onto an SD card and boot the Pi with it. Then once the Pi is booted perform the following from the command line:

          tar zcf my-kernel.tgz /boot/kernel.img /lib/modules

          You will end up with a tar gzipped file that includes the kernel and modules. Copy this file somewhere safe so you can extract it to your custom image.

          You may also want to copy the following file from the working image for reference:-

          To extract the kernel+modules to your custom image do the following:
          1) copy the “my-kernel.tgz” file to your new custom image
          2) from a command line
          sudo tar zxvf my-kernel.tgz -C /

          Tip: you might want to backup /boot/kernel.img and /lib/modules first.

          Hope that helps.




    I got an error on first try, after reboot:

    sudo tar zxf fbtft-kernel-03.tgz -C /
    tar: boot/kernel-cooljc.img: Cannot change ownership to uid 1000, gid 1000: Operation not permitted
    tar: boot: Cannot change ownership to uid 1000, gid 1000: Operation not permitted
    tar: Exiting with failure status due to previous errors

    Any ideas?


    • dmesg:

      [ 11.886409] fbtft_device: SPI devices registered:
      [ 11.909001] fbtft_device: spidev spi0.0 500kHz 8 bits mode=0x00
      [ 11.917265] fbtft_device: spidev spi0.1 500kHz 8 bits mode=0x00
      [ 11.925710] fbtft_device: ‘fb’ Platform devices registered:
      [ 11.937631] fbtft_device: bcm2708_fb id=-1 pdata? no
      [ 11.948886] fbtft_device: Deleting spi0.0
      [ 11.957321] fbtft_device: GPIOS used by ‘tontec35_9486’:
      [ 11.979399] fbtft_device: ‘reset’ = GPIO15
      [ 11.985074] fbtft_device: ‘dc’ = GPIO25
      [ 11.994227] fbtft_device: ‘led_’ = GPIO18
      [ 12.009292] fbtft_device: SPI devices registered:
      [ 12.015380] fbtft_device: spidev spi0.1 500kHz 8 bits mode=0x00
      [ 12.039190] fbtft_device: fb_ili9486 spi0.0 128000kHz 8 bits mode=0x03
      [ 12.197007] ads7846_device: Deleting spi0.1
      [ 13.117060] graphics fb1: fb_ili9486 frame buffer, 480×320, 300 KiB video memory, 4 KiB DMA buffer memory, fps=20, spi0.0 at 128 MHz
      [ 13.171730] ads7846 spi0.1: touchscreen, irq 174
      [ 13.209008] input: ADS7846 Touchscreen as /devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.1/input/input0

      • Hi Shawn,

        Make sure you update /boot/cmdline.txt or /etc/modules to reflect the device change.

        It needs to be “tontec35_61581” not “tontec35_7846”.



          • dmesg:

            [ 12.630173] fbtft_device: SPI devices registered:
            [ 12.636607] fbtft_device: spidev spi0.0 500kHz 8 bits mode=0x00
            [ 12.649438] fbtft_device: spidev spi0.1 500kHz 8 bits mode=0x00
            [ 12.658170] fbtft_device: ‘fb’ Platform devices registered:
            [ 12.669501] fbtft_device: bcm2708_fb id=-1 pdata? no
            [ 12.676570] fbtft_device: display not supported: ‘tontec35_61581’
            [ 12.795581] ads7846_device: Deleting spi0.1

          • Hi Shawn,

            It seams that you are not running my updated kernel. Did you miss the following step?

            # change /boot/config.txt
            # Find the line that starts with “kernel=” and change it
            # to read “kernel=kernel-cooljc.img”.
            # If the line does not exist then just add it to the bottom of the file.
            # Once changed save it and exit.



    • Hi Shawn,

      This is normal as the /boot partition is FAT32 (Windoze) and does not support permissions.



      • Hello Jon,

        I do have exactly the same error as Shawn. I used wget for your Tontec MZ61581. After backups, the unpacking of the kernel produced the following output:

        tar: boot/kernel-cooljc.img: Cannot change ownership to uid 1000, gid 1000: Operation not permitted
        tar: boot: Cannot change ownership to uid 1000, gid 1000: Operation not permitted
        tar: Exiting with failure status due to previous errors

        I still ran through your instructions, set the kernel (the line did not exist) and also added the device name in the modules (the line did not exist).

        After rebooting, the tontec screen still is blank – but the hdmi shows a rainbow picture.

        Now the Pi does not even boot.

        Best Toby

        • Hi Toby,

          The MZ61581 should be supported by the default kernel from raspberry pi. However you will need to get a device tree overlay file first.
          See here for instructions on building dti files:
          Here is the dti file you will need for the MZ61581:
          You will probably need to undo changes you have made to the files listed in my howto. Bare in mind that my howto is more than 6 months old now and things in Linux move quite fast. So the newer Raspberry pi images have probably moved past where things were at when I wrote the howto.

          Regarding the tar errors/warnings. These are because the /boot partition on the SD card is FAT32. FAT32 does not support Linux file permissions (read/write/execute and user/group etc) so when tar tries to set these attributes on the file the file system generates an error. These are nothing to worry about.

          If I get some time I might do an updated page showing how to use the dti files for the MZ61581. No promises though.


  17. Hello, i have setup the screen (i have the same LCD as “Kai”

    When Raspberry is booting up, it pass from the HDMI to LCD (Normal)

    But, when i tried to launch “startx” i have a black screen and after few minutes, i get error messages:

    (many message with “No protocol specified”)

    At the end i have:

    xinit: giving up
    xinit: unable to connect to X server: Resource temporarily unavailable

    waiting for X server to shut down Server terminated sucessfully (0). Closing log file

    What is wrong?

    I have tried to copy the same configuration as the Image on the DVD with the LCD screen but is not working, i have also tried with “Kai” configuration , but it make this error. i dont know what’s wrong and what i can do for resolve this problem.

    Thanks in davance for answer.

    Best Regards

    • Hi Etienne,

      Did you start from a clean raspbian image?
      If you have used any settings/config data from another source (eg DVD) then it might not be compatible with my howto.

      Also make sure you have created “/usr/share/X11/xorg.conf.d/99-fbdev.conf” correctly. If you copy and paste from web browser to nano you might end up with the incorrect quote (“) characters.

      Also confirm you have the “/dev/fb1” device file. If not then you are not running the fbtft driver.



      • Hello,

        I have remake with a clean image and now it was working fine,

        I dont know whats wrong with the other image, but now it’s working 🙂

        Thanks 🙂

  18. FYI: correct config.txt changes to boot index

    According to the instructions in the driver for “JBtek Latest Version 3.5 inch TFT LCD” [1407487919.rar] posted on the product support page,

    ” 1.) Make changes to config.txt

    Go into the “boot” index, enter the command:

    $ sudo nano config.txt

    next, find the lines

    # uncomment to force a console size. By default it will be display’s size minus
    # overscan.


    So the frame buffer is larger than the screen resolution apparently.

    A.) Is it best to define the framebuffers or does it default to best size?

    B.) Is it possible to use this driver for the “latest” model?

    • Hi Shawn,

      Don’t confuse the so called “driver” provided by JBtek and the one that I have documented. They are not the same or compatible with each other. Mixing information for the JBtek documents and mine is a recipe for failure.

      A) The framebuffer_* values in the config file are specifically for the Raspberry Pi’s own display controller presented on /dev/fb0. Changing these will not have any effect on the fbtft driver presented on /dev/fb1. Although changing them to a value not supported by your TV/monitor connected to the HDMI interface might prove problematic.

      B) My blog post covers using the official fbtft kernel from Notro’s git repository. His driver has support for the ili9481 (boards before 02 July 2014) and ili9486 (boards after 02 July 2014) display chips. My experimental fbtft-kernel-0.3 was build based on the information in issue222 to support the devices with 61581 chip set. I don’t have one of these displays and built it for you to try. Another user comment from “Anti” says he has successfully managed to get it to work.

      FYI: The displays native resolution is 480×320 and this is hard coded into the fbtft driver.

      I suggest you start again with a clean image of raspbian and don’t use anything from JBtek.



  19. On step 4 I get to inputting my tontec display and printed on my board I have MZJD35H-PI-EXT and I have no idea what to put :/

    • Hi Mike,

      I’ve got the same screen… MZJD35H-PI-EXT….
      It seems it’s using a different TFT display than the 9481 and 9486…
      So this solution doesn’t work for us 🙁

      If it can help you, I managed to have it work following the instructions here:

      BUT, this driver has a problem of huge CPU consumption…

      Best regards,

  20. Hi Jon,

    I bought this screen months ago and tried to have it work without success with the originals drivers…
    And then I forgot it as I had many other things to do…
    Today, I tried again and managed to get it work with the original drivers but i encountered its high CPU consumption problem…
    And then I found this post and decided to try this method… But I’m unsuccessful! This screen is driving me crazy!
    I followed steps 1 to 4… (just stopped before X configuration)… When I reboot my RPI, I can see the screen is turning on (light behind the screen), but I can’t see anything on the display (nothing being printed). It stay desperatly black…
    I have a 9481 version I think (“2014.7.2” is printed on the board) so I used “tontec35_9481” in the /etc/modules file…

    Do you have an idea? could you help?

    Sorry for my poor english…
    With many thanks,

    • Hi Christophe,

      For boards on/after 2nd July 2014 you should use tontec35_9486 as the driver.



      • Hi Jon,

        I changed from tontec35_9481 to tontec_9486 in /etc/modules but I got the same result…
        No text printed on the display….
        The result in dmesg seems okay (but it was already the case with the 9481 driver…):

        [ 12.372132] fbtft_device: SPI devices registered:
        [ 12.383279] fbtft_device: spidev spi0.0 500kHz 8 bits mode=0x00
        [ 12.392087] fbtft_device: spidev spi0.1 500kHz 8 bits mode=0x00
        [ 12.401072] fbtft_device: ‘fb’ Platform devices registered:
        [ 12.408230] fbtft_device: bcm2708_fb id=-1 pdata? no
        [ 12.423663] fbtft_device: Deleting spi0.0
        [ 12.430879] fbtft_device: GPIOS used by ‘tontec35_9486’:
        [ 12.446645] fbtft_device: ‘reset’ = GPIO15
        [ 12.452304] fbtft_device: ‘dc’ = GPIO25
        [ 12.472395] fbtft_device: ‘led_’ = GPIO18
        [ 12.482780] fbtft_device: SPI devices registered:
        [ 12.493274] fbtft_device: spidev spi0.1 500kHz 8 bits mode=0x00
        [ 12.510144] fbtft_device: fb_ili9486 spi0.0 128000kHz 8 bits mode=0x03
        [ 13.700621] graphics fb1: fb_ili9486 frame buffer, 480×320, 300 KiB video memory, 4 KiB DMA buffer memory, fps=20, spi0.0 at 128 MHz

        Any other idea?


        • Hi Christophe,

          1) When you started did you use a clean image?
          2) Did you continue from the image that you used for the original drivers?

          If 2) then you need to start from a clean image or undo all the changes you made for the original drivers.



          • No, i didn’t restart with a clean image 🙁
            I just erased all the changes I had done for the “originals” drivers

            Ok, I’ll try to restart from a fresh and clean new image

            Thanks a lot

          • Hi Jon,

            So, I did a fresh reinstall of raspbian…
            – Formatted my SD Card
            – copied the NOOBS files on it
            – did a full Raspbian re-install using the SDCard
            – configured my WiFi network
            – updated Raspbian:
            sudo apt-get update
            sudo apt-get upgrade
            – installed the driver using the “sudo REPO_URI= rpi-update” command. When I try this command again, it tell me “Your firmware is already up to date” so I think it’s okay.
            – Rebooted
            – DidN’T edit the /etc/modprobe.d/raspi-blacklist.conf file as there is no such file on my RasPi after the re-install ! (perhaps a problem here?). I did a “grep spi *” in the /etc/modprobe.d folder and it didn’t return any result…
            – modified the /etc/modules file to use the tontec_9486 driver
            – edited the /boot/cmdline.txt file, I just had to add the “fbcon=map:10” text I think… here’s the new content (in one line):
            dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p6 rootfstype=ext4 elevator=deadline fbcon=map:10 rootwait
            – Rebooted….

            And… still nothing showing on the display… But I can see it’s turned on during the boot process (white backlight)…
            I tried to change the driver to tontec35_9481 but got the same result…

            My Raspi is well booted, I can connect and use it via ssh. the dmesg seems okay…
            If I plug back an HDMI screen, I can see it’s resolution is changed to 480×320 after the driver is loaded…

            Am I missing something?
            I’m pretty sure the screen is working as I managed to make it work with the originals drivers (but with the high CPU consumption problem…)

            Sorry to bother you with that but it’s very frustrating…

            Best regards,

          • Hi Christophe,

            Please can you provide the output of “lsmod” command, “ps ax” command and “uname -a” command?

            Also I am wondering why you HDMI has changed to 480×320. Did you change /boot/config.txt to set framebuffer_*?

            Is your board definitely a TonTec board? Can you provide the full text string printed on the back of the PCB?



          • Hi Christophe,

            I have one more for you to try.
            Same procedure as before but this time use this kernel:

            And in /etc/modules use:

            If this does not work you could contact TonTec customer support and ask them what LCD display is being used in this model. More specifically if they have a datasheet for the device (register settings). If you can get this information then maybe I can create a driver for it.



          • Jon,
            Here are the requested informations

            pi@RPITOF ~ $ lsmod
            Module Size Used by
            fb_ili9486 3115 1
            fbtft_device 34686 0
            fbtft 30834 2 fb_ili9486,fbtft_device
            syscopyarea 2999 1 fbtft
            sysfillrect 3294 1 fbtft
            sysimgblt 2124 1 fbtft
            fb_sys_fops 1435 1 fbtft
            snd_bcm2835 19496 0
            snd_soc_pcm512x 9034 0
            snd_soc_tas5713 5573 0
            snd_soc_wm8804 7932 0
            snd_soc_bcm2708_i2s 6186 0
            regmap_mmio 2818 1 snd_soc_bcm2708_i2s
            snd_soc_core 146249 4 snd_soc_pcm512x,snd_soc_wm8804,snd_soc_tas5713,snd_soc_bcm2708_i2s
            8192cu 550885 0
            snd_compress 12594 1 snd_soc_core
            regmap_i2c 1661 4 snd_soc_pcm512x,snd_soc_wm8804,snd_soc_core,snd_soc_tas5713
            snd_pcm_dmaengine 5505 1 snd_soc_core
            regmap_spi 1913 3 snd_soc_pcm512x,snd_soc_wm8804,snd_soc_core
            snd_pcm 83853 3 snd_bcm2835,snd_soc_core,snd_pcm_dmaengine
            snd_page_alloc 5140 1 snd_pcm
            snd_seq 55476 0
            snd_seq_device 6465 1 snd_seq
            snd_timer 20981 2 snd_pcm,snd_seq
            leds_gpio 2079 0
            led_class 4373 1 leds_gpio
            snd 62252 7 snd_bcm2835,snd_soc_core,snd_timer,snd_pcm,snd_seq,snd_seq_device,snd_compress
            spi_bcm2708 8111 0
            i2c_bcm2708 4943 0
            joydev 9257 0
            evdev 10713 3

            pi@RPITOF ~ $ ps ax
            1 ? Ss 0:01 init [2]
            2 ? S 0:00 [kthreadd]
            3 ? S 0:00 [ksoftirqd/0]
            5 ? S< 0:00 [kworker/0:0H]
            6 ? S 0:00 [kworker/u2:0]
            7 ? S 0:00 [rcu_preempt]
            8 ? S 0:00 [rcu_bh]
            9 ? S 0:00 [rcu_sched]
            10 ? S< 0:00 [khelper]
            11 ? S 0:00 [kdevtmpfs]
            12 ? S< 0:00 [netns]
            13 ? S< 0:00 [writeback]
            14 ? S< 0:00 [bioset]
            15 ? S< 0:00 [crypto]
            16 ? S< 0:00 [kblockd]
            17 ? S 0:00 [khubd]
            19 ? S< 0:00 [rpciod]
            20 ? S 0:00 [khungtaskd]
            21 ? S 0:00 [kswapd0]
            22 ? S 0:00 [fsnotify_mark]
            23 ? S< 0:00 [nfsiod]
            29 ? S< 0:00 [kthrotld]
            30 ? S< 0:00 [VCHIQ-0]
            31 ? S< 0:00 [VCHIQr-0]
            32 ? S< 0:00 [VCHIQs-0]
            33 ? S< 0:00 [iscsi_eh]
            34 ? S< 0:00 [dwc_otg]
            35 ? S< 0:00 [DWC Notificatio]
            37 ? S 0:00 [VCHIQka-0]
            38 ? S< 0:00 [SMIO]
            39 ? S< 0:00 [deferwq]
            40 ? S 0:00 [mmcqd/0]
            41 ? S 0:00 [kworker/u2:2]
            42 ? S 0:00 [jbd2/mmcblk0p6-]
            43 ? S No I didn’t change anything in the /boot/config.txt file

            => The full text on the back of the screen board is :
            MZJD35H-PI-EXT 2014.7.2
            Tontec (R)

            => There’s a chip on the back of the board with the following text on it:

            S BCB77

            => And a smaller chip with the following text on it:

            H204 5

            Best regards

          • Hi Chrstophe,

            My screen has MZ9486-PI-EXT this means it uses ili9486 LCD panel. The other one I know that works is MZ9481-PI-EXT which has an ili9481 LCD panel. The 3rd one I know that is working is MZ61581-PI-EXT (has a R61581 LCD panel). Yours has completely different different model name that might suggest it uses another chip unknown to fbtft drivers.

            You say you had it working with the manufactures driver? Where did you get this driver and is there source code?



          • And here’s the content of /boot/config.txt (uncommented text at the end of the file, all the rest of the file is commented)

            # NOOBS Auto-generated Settings:


          • Hi Jon,

            No luck, didn’t work with this last try (tontec35_61581).

            Ok, I’ll try to contact Tontec and ask them the information you requested.
            I’ll keep you informed

            Best regards,

          • Hi Christophe,

            I have taken the init settings from the code at and added then to a new driver in fbtft.
            I have then created a new experimental kernel image with the driver in it.

            You can install and try using the instructions below. Please let me know if it works.



          • Hi Jon,

            No, still not working… same result…

            => dmesg content related to the fbtft driver:
            [ 15.140717] fbtft_device: SPI devices registered:
            [ 15.154245] fbtft_device: ‘fb’ Platform devices registered:
            [ 15.171302] fbtft_device: bcm2708_fb id=-1 pdata? no
            [ 15.184958] fbtft_device: GPIOS used by ‘tontec35_mzjd35h’:
            [ 15.192480] fbtft_device: ‘reset’ = GPIO15
            [ 15.214639] fbtft_device: ‘dc’ = GPIO25
            [ 15.220519] fbtft_device: ‘led_’ = GPIO18
            [ 15.239853] fbtft_device: SPI devices registered:
            [ 15.253202] fbtft_device: fb_mzjd35h spi0.0 128000kHz 8 bits mode=0x03
            [ 16.653121] graphics fb1: fb_mzjd35h frame buffer, 480×320, 300 KiB video memory, 4 KiB DMA buffer memory, fps=20, spi0.0 at 128 MHz

            => lsmod result:
            pi@RPITOF ~ $ lsmod
            Module Size Used by
            fb_mzjd35h 3441 1
            fbtft_device 35362 0
            fbtft 35313 2 fbtft_device,fb_mzjd35h
            syscopyarea 3153 1 fbtft
            sysfillrect 3584 1 fbtft
            sysimgblt 2278 1 fbtft
            fb_sys_fops 1565 1 fbtft
            snd_bcm2835 21342 0
            snd_soc_tas5713 5866 0
            snd_soc_wm8804 8225 0
            snd_soc_pcm512x_i2c 2130 0
            snd_soc_pcm512x 8468 1 snd_soc_pcm512x_i2c
            regmap_spi 2307 1 snd_soc_wm8804
            regmap_i2c 2944 3 snd_soc_wm8804,snd_soc_pcm512x_i2c,snd_soc_tas5713
            snd_soc_bcm2708_i2s 7539 0
            regmap_mmio 3548 1 snd_soc_bcm2708_i2s
            snd_soc_core 177920 4 snd_soc_pcm512x,snd_soc_wm8804,snd_soc_tas5713,snd_soc_bcm2708_i2s
            snd_compress 8698 1 snd_soc_core
            snd_pcm_dmaengine 5850 1 snd_soc_core
            snd_pcm 93100 4 snd_bcm2835,snd_soc_wm8804,snd_soc_core,snd_pcm_dmaengine
            snd_seq 61097 0
            joydev 9766 0
            snd_seq_device 7209 1 snd_seq
            snd_timer 23007 2 snd_pcm,snd_seq
            evdev 11000 3
            8192cu 569585 0
            snd 67211 7 snd_bcm2835,snd_soc_core,snd_timer,snd_pcm,snd_seq,snd_seq_device,snd_compress
            spi_bcm2708 6018 0
            i2c_bcm2708 6004 0

            Best regards,

  21. Got a little farther, I went to reboot at the end of step 4, afterwards the screen didn’t light up and then on the tv the cmd froze up.

    Looks like it got down to Ext4-fs (mmcblk0p2) unable to read superblock. Then it gives a list of partitions. Then says no filesystem could mount root, tried: [ 2.549802] usb 1-1: new high-speed USB device number 2 using dwc_otg ext4
    Kernel panic- not syncing: VFS: Unable to mount root fs on unknown-block(179,2)

    After that there’s a little bit more code but it all seems to stem from above. I went back in and made sure my cmdline.txt read dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fbcon=map:10 rootwait

  22. Hi, Jon!

    I’ve got this kind of LCD screen from eBay ( for my Raspberry Pi B+ and am planning to try to make it work on PiCore-6.0 (TinyCore Linux OS for Raspberry Pi).
    I’m very new to Linux, what do you suggest to start with to set up all the LCD drivers on PiCore?

    • Hi Nickel,

      Thank you for your comment. First I would suggest trying to get it to work using Raspbian as my how to describes. Once you have confirmed the screen is working using Raspbian you might be able to apply the same changes to TinyCore Linux. I have not tried TinyCore so I don’t know if it uses the same module loading scripts.

      Additionally please bare in mind that my how to is for TonTec 3.5″ screens. The ebay listing does not mention TenTec in the description so my instructions might not work for you.



      • According to what is written on the board of the screen – it is TonTec 3.5″ (, the link in eBay item Description leads to the driver – it is “mzl350i-pi-ext”.

        I’ve tried to follow instructions from an eBay listing, but that didn’t work for me – I’ve chmod’ed “lcd” file, copied it to “init.d” and even was successful in writing the “lcd” script to automatic boot, but the screen just lighted white all the time and nothing shown on it… I was trying to wait for some time and then I thouht it just hung up and I turned off the power from Raspberry. Once I’ve turned it on again – the system shown to me, that my SD card is corrupted because of unexpected turn off 🙂

        I hope to just verify, if the screen is working, just some simple steps to see if it is working at all… And then I’ll try to set it up within your instructions.
        Is there any way to quickly see if the screen is just working before trying your instruction?

  23. Hi, Jon!
    I have 3.5″ Tontec TFT, model “MZ61581-PI-EXT 2014.12.28”.
    Is it compatible with your Tutorial?

    • Hi Nickel,

      See in the comments. I have created an experimental kernel with support for this device. I don’t have that screen myself so I cannot test it myself. Look for comments that include “tontec35_61581”.



  24. Hi Jon
    Thanks for your tutorial. I have the tontec model MZ9486-PI-EXT dated 2014.10.8, mz9486 is metioned, but I am confused about what instructions I need to follow, if any to get this display working. Thanks

      • Hi Jon
        Thanks for getting back to me. Guess what, it did not work for me. Just have a back lit display. My blacklist entry was blank so I just added the details from your tutorial. Any ideas please.

          • Hi Roger,

            Great news. Thanks for letting me know. Please bare in mind that my kernel is experimental and if you perform a rpi-update it might get replaced by the official kernel.

            There is work going on to include fbtft driver in the official kernel sources which means that it will also get into the official RPi kernel some day. Although I need to create a kernel patch for the 61581 and submit it. I don’t have time right now but I will get around to it eventually. However I think tontec should really be the people to do this as they are selling the devices and don’t seam to support them very well.

            Anyway enjoy the screen.



  25. Disclaimer, I am new to the Pi and I am rusty in Linux. I bought the Tontec 3.5 for my Raspberri Pi 2. and the OS that came with it locks up on the start and that’s it. So I installed a fresh copy of Raspian and I came upon your site.

    So I followed your instructions but one part in step 4 where you edit the /etc/modprobe.d/raspi-blacklist.conf, well I don’t have one. So I did skipped this part. I am getting an error when I run startx. Should I create the blacklist.conf that I am missing and add your commands?

    I agree, Tontec should be helping users out with their products. Thanks for all the help.

    • Hi Aaron,

      I have not tried using my display on a RPi2 yet. The only issue you might face is that the kernel (and other firmwares) I reference on my pace my not run correctly because it is built of an ARM6 core.

      Regarding the SPI not being in the black list. From what I have read the Pi kernel is now using device tree blobs. So you will need to activate the SPI interface by adding an entry to the /boot/config.txt file.

      This should do what you want:

      You can read more about it here:

      I hope that helps.



  26. Dear Jon,

    This is from the Tontec manufacturer. We have upgraded all the tontec 3.5 inch TFT screen to a newer version which is now supported by notro Device Tree. Would you please contact us by email and we are very glad to provide you a sample for free to test. Thank you so much for your contribution and help for others who are using Tontec Screen.

    • Dear Tontec,

      Thank you for your comment and kind offer. I have sent you an email directly.



    • Hi,

      Thanks for you comment.
      I have tried this a few days ago and found that step 3 was not required.



    • Hi Amro,

      It is more than likely that this how to will not work for the 3.2″ screen.



  27. Hello. This reply is for my personal experience with setting up the Tontec 3.5 inch TFT. Hopefully this can help to fully understand any issues anybody has. The specific board used is the MZJD35H-PI-EXT 2014.7.2 which is supported under tontec35_9481 in the fbtft_device module. Before following the instructions here, the instructions on the GitHub Notro wiki were used to test everything.

    Started with a clean image of NOOBS and installed Raspbian.
    Setup raspi-config.
    Used the following commands:
    sudo rpi-update
    sudo nano /boot/config.txt
    Added the following at the end:
    CTRL+X then Y then Enter
    sudo reboot
    Enter credentials to log in.
    sudo modprobe fbtft_device name=tontec35_9481
    con2fbmap 1 1

    At this point the command line text switches to the Tontec and the default display appears to freeze. Whatever I type is shown on the Tontec. Once satisfied, typed the reboot command.

    Enter credentials to log in.
    sudo modprobe fbtft_device name=tontec35_9481
    FRAMEBUFFER=/dev/fb1 startx

    Here lies my first problem, it does not switch to the GUI on the Tontec but on the default display. Before I continue to make it permanent, it has to pass the test which it failed in this case.

    Any suggestions?

  28. Jon,

    great work here

    I tried these instructions ( with the MZ9486-PI-EXT dated 2014.10.8

    I get a display and the touch works fine, but the display is inverted (i can view it fine if reflected in a mirror), I know these instructions are not yours (or for the 9486 model) but was wondering if you had any idea how to invert the display so it showed correctly on the screen?

    I’m looking at this solution as this is included in the 2015-02-16-raspbian-wheezy image and i won’t have to re-install kernals if updating my raspberry pi

  29. Sir
    Can I use same procedure for Adafruit piTFT 2.8″ resistive display or some changes are needed? can you please suggest it? I think the controller for piTFT is quite same and compatible (fbtft driver supports piTFT). I can not use display driver provided from adafruit since I am using Yocto to build LINUX.

    • Hi Abhishek,

      You can more or less use the same procedure but the specific details I cannot help with as my tutorials are for the Tontec 3.5″ displays and the driver is slightly different.

      The fbtft driver has now been integrated into the mainline kernel so the chances are it is already included in current versions of the Raspberry Pi kernel. You will just need to find out how to enable it.

      Read the following wiki:
      Pay attention to the post dated 2015-03-27 where notro mentions your display (pitft overlay changed name to pitft28-resistive).

      I hope that helps.



    • Hi Ciar,

      The tutorial should work on any distro really but some of the config files for kernel modules might be placed in different directories or have different filenames.

      However you might not need to build it yourself as the fbtft driver is now included in the mainline kernel sources (at least as experimental). It now uses device tree overlays (see The latest TonTec screens seam to be using MZ61581 displays so if yours has “MZ61581-PI-EXT 2014.12.28” printed on the back of the LCD PCB you can probably use the example overlay here:
      If not then you might be able to create your own overlay looking at the source for the older boards and changing things to match.

      I hope that helps.