element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Single-Board Computers
  • Products
  • Dev Tools
  • Single-Board Computers
  • More
  • Cancel
Single-Board Computers
Forum [How-to] BB-View on latest Debian
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Single-Board Computers to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 142 replies
  • Subscribers 63 subscribers
  • Views 20414 views
  • Users 0 members are here
  • debian
  • embedded_linux
  • bb-view
  • bbb
Related

[How-to] BB-View on latest Debian

compeoree
compeoree over 11 years ago

I thought some others might like to know how to get the BB-View working under the latest Debian beta images.

 

Unfortunately, you are going to have to recompile the Kernel. The video works fine without a recompile (the red/blue swap is easy to fix), but the touchscreen control connections are not the same as the standard TI 4-wire interface. I tried to patch the ti_am335x_tsc.c file, so the changes would be limited to a dts recompile, but I haven't been able to get that working yet (I'm pretty sure it is a state machine / bit assignment issue). But anyway, here are the steps that you need to perform.....

 

Overview

1) Download the necessary files

     a) Robert Nelson's handy tools for compiling the Beaglebone kernel

     b) BB-View source for Angstrom

2) Build the default kernel

3) Patch the Kernel and perform a fast recompile

4) Copy the new kernel to the Beaglebone

5) Edit the xorg.conf file to correct the Red/Blue color swap

6) Revel in the 4 days you just saved image

 

Let's Get Started

I am using Ubuntu 12.04 LTS 64 bit running in a VirtualBox VM to compile the kernel:

Make a new folder called bb-view, this is where our build will happen.

> mkdir bb-view

> cd bb-view

 

Install git, if you haven't already:

> apt-get install git

 

Clone Robert Nelson's linux-dev project locally. Be prepared for a large download (~100 Mb for the cross-compiler and ~700 Mb for the kernel source).

> git clone https://github.com/RobertCNelson/linux-dev.git

 

Change into the new linux-dev folder and select branch/tag that matches the Debian version.

> cd linux-dev

> git checkout 3.8.13-bone37 -b tmp

 

Now we need to build the base image, so our cape drivers folder gets populated. The script will tell you if you need to do or install anything else.

> ./build_kernel.sh

 

Come back in an hour or so.....(You might want to download the Angstrom source from element14 now)

 

Patching the Kernel

Extract two files from the Angstrom source:

> unzip angstrom-source.zip

> tar -zxf bb-black-kernel-3.8.13-bb-view.tar.bz2

> cp ./kernel/kernel/drivers/input/touchscreen/ti_am335x_tsc.c  ~/bb-view/linux-dev/KERNEL/drivers/input/touchscreen/

> cp ./kernel/kernel/firmware/capes/BB-VIEW-LCD7-01-00A0.dts  ~/bb-view/linux-dev/KERNEL/firmware/capes/

 

Now we need to let the compiler know that we want to add the firmware to the build:

> nano   ~/bb-view/linux-dev/KERNEL/firmware/Makefile

 

Add the following line somewhere near line 192 (CTRL-C will display current cursor position):

BB-VIEW-LCD7-01-00A0.dtbo \

 

Don't forget the trailing backslash....it is important. Now save and exit by doing CTRL-O, Enter, CTRL-X.

Change back to the linux-dev root folder:

> cd   ~/bb-view/linux-dev

 

Now issue the kernel rebuild command, this won't take very long at all:

> ./tools/rebuild.sh

 

 

Copy Kernel to BBB

The following instructions assume that you already have the Debian beta installed and booted up on the BBB.

The easiest way is to copy the files over the network, via the 'scp' command:

> scp   ~/bb-view/linux-dev/deploy/3.8.13-bone37.zImage   debian@192.168.7.2:/home/debian

Replace debian (both instances) with the username you are running on the BBB and 192.168.7.2 with the IP address of the BBB.

 

Now log into the BBB and copy the kernel image to the boot partition:

> ssh debian@192.168.7.2

bbb>  sudo cp 3.8.13-bone37.zImage   /boot/uboot/zImage

 

We need to do one more thing before the LCD will work. Since the cape doesn't have an EEPROM, we need to black-list the HDMI drivers and force-load the BB-VIEW drivers in the boot command file:

bbb>  sudo  nano  /boot/uboot/uEnv.txt

 

Find the "optargs" line and edit it to be:

optargs=capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN  capemgr.enable_partno=BB-VIEW-LCD7-01

Notice that the preceding "#" has been removed. You don't want to disable BB-BONE-EMMC-2G, or you won't be able to boot from eMMC.

Now save and exit by doing CTRL-O, Enter, CTRL-X.

 

Reboot the BBB and the LCD should now work....except the blue and red are reversed.

 

Fixing Red/Blue Color Swap

This is due to errata in the TI AM335x processor when switching between 16 and 24 bit video modes. To fix this, we must first find the name of our screen:

> ssh debian@192.168.7.2

bbb> cat  /var/log/Xorg.0.log  |  grep  screen

Mine was "Builtin Default fbdev Screen 0"

 

Now we edit our X configuration file:

bbb> sudo nano  /usr/share/X11/xorg.conf.d/10-evdev.conf

 

and add a "Screen" section at the end of the file:

Section "Screen"

        Identifier "Builtin Default fbdev Screen 0"

        Monitor "Configured Monitor"

        Device "Configured Video Device"

        DefaultDepth 24

EndSection

Save and exit by doing CTRL-O, Enter, CTRL-X.

Reboot and enjoy!

  • Sign in to reply
  • Cancel

Top Replies

  • Former Member
    Former Member over 11 years ago in reply to Former Member +1
    Hello selsinork, "Which kernel version are you using ?" I use the 3.8. "Did you apply the patch Louis posted ?" I rebuild the kernel with Louis' edits in the "4. Re:[How-to] BB-View on latest Debian" message…
  • Former Member
    Former Member over 11 years ago in reply to Former Member +1
    Ok, so with the overlay loaded then the touch screen driver should be able to work. You can check the proper device using 'evtest' like this: root@lcd:~/evtest# ./evtest No device specified, trying to…
  • Former Member
    Former Member over 11 years ago in reply to Former Member +1
    Interesting. I seem to remember that one of the LEDs on the cape was configured as heartbeat. Perhaps that was the TI-SDK image then as looking at the overlay files I see: gpio-leds-cape-lcd { compatible…
  • Former Member
    Former Member over 11 years ago

    Perfect timing, I was just about to start looking for what pieces I need to extract in order to get the 4.3" BB-View working on a vanilla 3.13 kernel. Looks like you've identified the interesting pieces for me image

     

    When you say the touch screen is different from the standard TI 4 wire interface, how did you work that out ?  Did you find schematics for the BB-View anywhere ?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 11 years ago in reply to Former Member

    From the Angstrom source download, a diff between BB-BONE-LCD4-01-00A1.dts & BB-VIEW-LCD4-01-00A0.dts is interesting, there's a couple of differences in the pins used for LEDs & keys along with differences in numbers of leds & keys.

    Other than that, there's one extra pin used for "LCD DISEN" in BB-BONE-LCD4-01-00A1.dts and for the BB-VIEW there's this

     

    ti,touch-type = <1>;

    in the LCD7 ones the BB-VIEW has that as 2

     

    Not exactly sure what that does just yet, but it's obviously some hint to the driver to configure something a certain way. Otherwise the driver and pins used appear to be identical.  Perhaps it's a place to start looking for the problem though.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • compeoree
    compeoree over 11 years ago in reply to Former Member

    If you do a diff between the ti_am335x_tsc.c files, you will see the changes. It appears to use bits 9 and 10 (STEPCONFIG_XNP and YPN) for sequencing, instead of the usual bits 7 and 8.

     

    Modifications to Debian original ti_am335x_tsc.c:

    I added the two new bit definitions to the config_pins array assignment on line 38. I then changed line 98 from switch(wi_order) to switch(i), so that it would assume XP, XN, YP, and YN from array position in the dts file. The fun part is trying to figure out which combination of dts "ti,wire-config" values and changes to lines 180 and 187 will result in a working touchscreen.

     

    I think I focused too much on just the changed lines and not the relationship between the lines that didn't change, especially between lines 178 to 198. I will look into that today.

     

    Louis

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • compeoree
    compeoree over 11 years ago in reply to compeoree

    Well, the recompile seems unavoidable due to the way the charge bits are used. I have made changes to the stock touchscreen drivers, to add a hook for the BB-View, but also to keep compatibility with other displays. I will see if I can get someone to include them in the next kernel patch.

     

    For some reason, the xinput_calibrator is not working properly with the values being returned by the tsc. Manually modify your /etc/pointercal.xinput file, on the bbb, to the following, to get it close:

    xinput set-int-prop "ti-tsc" "Evdev Axis Calibration" 32 3953 130 366 3832; xinput set-int-prop "ti-tsc" "Evdev Axes Swap" 8 1;

     

    If you want to test out the kernel modules on your own, here are the diffs:

     

    diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c

    index ed83043..69bc5d9 100644

    --- a/drivers/input/touchscreen/ti_am335x_tsc.c

    +++ b/drivers/input/touchscreen/ti_am335x_tsc.c

    @@ -50,6 +50,7 @@ struct titsc {

      unsigned int x_plate_resistance;

      bool pen_down;

      int coordinate_readouts;

    + int charge_mode;

      u32 config_inp[4];

      u32 bit_xp, bit_xn, bit_yp, bit_yn;

      u32 inp_xp, inp_xn, inp_yp, inp_yn;

    @@ -176,16 +177,23 @@ static void titsc_step_config(struct titsc *ts_dev)

      /* Charge step configuration */

      config = ts_dev->bit_xp | ts_dev->bit_yn |

      STEPCHARGE_RFP_XPUL | STEPCHARGE_RFM_XNUR |

    - STEPCHARGE_INM_AN1 | STEPCHARGE_INP(ts_dev->inp_yp);

    + STEPCHARGE_INM_AN1;

    +

    + if (ts_dev->charge_mode == 1)

    + config |= STEPCHARGE_INP(ts_dev->inp_xn);

    + else

    + config |= STEPCHARGE_INP(ts_dev->inp_yp);

     

      titsc_writel(ts_dev, REG_CHARGECONFIG, config);

      titsc_writel(ts_dev, REG_CHARGEDELAY, CHARGEDLY_OPENDLY);

     

      /* coordinate_readouts * 2 … coordinate_readouts * 2 + 2 is for Z */

    - config = STEPCONFIG_MODE_HWSYNC |

    - STEPCONFIG_AVG_16 | ts_dev->bit_yp |

    - ts_dev->bit_xn | STEPCONFIG_INM_ADCREFM |

    - STEPCONFIG_INP(ts_dev->inp_xp);

    + config = STEPCONFIG_MODE_HWSYNC | STEPCONFIG_AVG_16 |

    + STEPCONFIG_INM_ADCREFM | STEPCONFIG_INP(ts_dev->inp_xp);

    + if (ts_dev->charge_mode == 1)

    + config |= STEPCONFIG_YPN | STEPCONFIG_XNP;

    + else

    + config |= ts_dev->bit_yp | ts_dev->bit_xn;

      titsc_writel(ts_dev, REG_STEPCONFIG(end_step), config);

      titsc_writel(ts_dev, REG_STEPDELAY(end_step),

      STEPCONFIG_OPENDLY);

    @@ -372,6 +380,11 @@ static int titsc_parse_dt(struct ti_tscadc_dev *tscadc_dev,

      if (err < 0)

      return err;

     

    + err = of_property_read_u32(node, "ti,charge-mode",

    + &ts_dev->charge_mode);

    + if (err < 0)

    + ts_dev->charge_mode = 0;

    +

      return of_property_read_u32_array(node, "ti,wire-config",

      ts_dev->config_inp, ARRAY_SIZE(ts_dev->config_inp));

    }

    @@ -389,6 +402,7 @@ static int titsc_parse_pdata(struct ti_tscadc_dev *tscadc_dev,

      pdata->tsc_init->x_plate_resistance;

      ts_dev->coordinate_readouts =

      pdata->tsc_init->coordinate_readouts;

    + ts_dev->charge_mode = pdata->tsc_init->charge_mode;

      memcpy(ts_dev->config_inp, pdata->tsc_init->wire_config,

      sizeof(pdata->tsc_init->wire_config));

      return 0;

    diff --git a/firmware/Makefile b/firmware/Makefile

    index e45d10b..f18b95a 100644

    --- a/firmware/Makefile

    +++ b/firmware/Makefile

    @@ -189,6 +189,7 @@ fw-shipped-$(CONFIG_CAPE_BEAGLEBONE) += \

      BB-BONE-RST-00A0.dtbo \

      BB-BONE-RST2-00A0.dtbo \

      BB-BONE-CAM3-01-00A2.dtbo \

    + BB-VIEW-LCD7-01-00A0.dtbo \

      BB-BONE-CAM-VVDN-00A0.dtbo \

      TT3201-001-01.dtbo \

      BB-BONE-SERL-03-00A1.dtbo \

    diff --git a/include/linux/input/ti_am335x_tsc.h b/include/linux/input/ti_am335x_tsc.h

    index c0bf08b..278125a 100644

    --- a/include/linux/input/ti_am335x_tsc.h

    +++ b/include/linux/input/ti_am335x_tsc.h

    @@ -30,6 +30,7 @@ struct tsc_data {

      int x_plate_resistance;

      int coordinate_readouts;

      int wire_config[10];

    + int charge_mode;

    };

     

    #endif

    diff --git a/firmware/capes/BB-VIEW-LCD7-01-00A0.dts b/firmware/capes/BB-VIEW-LCD7-01-00A0.dts

    index f506a15..9370327 100755

    --- a/firmware/capes/BB-VIEW-LCD7-01-00A0.dts

    +++ b/firmware/capes/BB-VIEW-LCD7-01-00A0.dts

    @@ -158,7 +158,7 @@

      ti,wires = <4>;

      ti,x-plate-resistance = <200>;

      ti,coordinate-readouts = <5>;

    - ti,touch-type = <2>;

    + ti,charge-mode = <1>;

      ti,wire-config = <0x00 0x11 0x22 0x33>;

      };

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 11 years ago in reply to compeoree

    Haven't got as far as looking at the touch screen parts yet...

     

    Question for you though.. if you set the brightness to something like 50 do you get an audible high pitched whine from the display ?  I have an LCD4, just wondering if your LCD7 does the same..

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • compeoree
    compeoree over 11 years ago in reply to Former Member

    Yes, I have heard it with the CircuitCo 7 inch screens, and a quick test with the BB-View 7 proves it does it too.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • compeoree
    compeoree over 11 years ago in reply to Former Member

    I modified the BB-View dts file, line 141, to read:

    pwms = <&ehrpwm1 0 32768 0>;

    and the noise is gone.....

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 11 years ago in reply to compeoree

    After what seems like way too long fighting with devicetree... It's alive !

    image

    ts_calibrate is of course giving me a pile of crap, so your patches to the touchscreen driver are next on the list.

     

    I should also say here that I'm not using the beaglebone kernels, I'm using mainline.. Gave up with the mess that's going into the beagle kernels a while ago.

    The TI folks doing the mainline devicetree development for am3359 (and omap in general) and the beagleboard folks are heading off in two totally different directions, the differences are significant at this point.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • compeoree
    compeoree over 11 years ago in reply to Former Member

    Very good. Just curious if you boot up in the proper color mode, or if you wait until X starts up like I do?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 11 years ago in reply to compeoree

    I don't have X installed, the tux logo has correct colours and that's just a jpg displayed with http://repo.or.cz/w/fbv.git

    I'd like to say I did something interesting to make it so, but I've not knowingly done so.

     

    The dt definition fro the panel is this:

    /* Embest 4.3 inch LCD cape: */

    panel {

            compatible = "ti,tilcdc,panel";

            pinctrl-names = "default";

            pinctrl-0 = <&bb_view_lcd_cape_pins>;

            status="okay";

     

            panel-info {

                    ac-bias         = <255>;

                    ac-bias-intrpt  = <0>; 

                    dma-burst-sz    = <16>;

                    bpp             = <32>;

                    fdd             = <0x80>;

                    tft-alt-mode    = <0>;  

                    stn-565-mode    = <0>;  

                    mono-8bit-mode  = <0>;  

                    sync-edge       = <0>;  

                    sync-ctrl       = <1>;  

                    raster-order    = <0>;  

                    fifo-th         = <0>;  

            };

     

            display-timings {

                    native-mode = <&timing0>;

                    timing0: 480x272 {

                            hactive         = <480>;

                            vactive         = <272>;

                            hback-porch     = <44>;

                            hfront-porch    = <9>; 

                            hsync-len       = <5>; 

                            vback-porch     = <13>;

                            vfront-porch    = <4>; 

                            vsync-len       = <10>;

                            clock-frequency = <9000000>;

                            hsync-active    = <0>;

                            vsync-active    = <0>;

                    };

            };

    };

     

    don't think I changed anything in that part from what was in the angstrom definition.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube