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 & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • 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 64 subscribers
  • Views 23713 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…
Parents
  • 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
  • Former Member
    Former Member over 11 years ago in reply to Former Member

    selsinork wrote:

    So I'm going to try your patch exactly as-is and see what happens.

    Well it works perfectly!

     

    Now I just need to try and understand how it all works..  I may be some time image

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

    Very good!

    Yeah, I think we need to know more about the low levels of the touch screen controller in the AM335x processors, in order to make the patch more universal.....see if this helps:

    image

    Taken from the AM335x Technical Reference Manual.

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

    Hello,

     

    I still have problem with ts_calibrate.  I read that it gived you a pile of crap....  could you explain how you managed to make it works please?

     

    I set the environment variable like this:

    export TSLIB_FBDEVICE=/dev/fb0

    export TSLIB_CONFFILE=/etc/ts.conf

    export TSLIB_PLUGINDIR=/usr/local/lib/ts

    export TSLIB_TSDEVICE=/dev/input/event1

     

    I tried also this :

    export TSLIB_TSDEVICE=/dev/input/mouse0 (and all others input devices..... )

     

    event1 and mouse0 are the two files that output something when I do :

    cat /dev/input/event1  or cat /dev/input/mouse0 and I touch the screen.

     

    but even if I configure the environment variable like above, I've got this message when I execute ts_calibrate:

    No raw module loaded.

    ts_config: No such file or directory


    have you got an idea? ( in /etc/ts.conf,  the line  module_raw input (linux input layer event interface) is not commented..)

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

    Two things of note are that the BB-View is different from the other CircuitCo LCD capes as far as the touch screen is concerned - I don't fully understand the details - and that while Louis provided a patch to the 3.8.13 kernel that Robert Nelson provides for his Debian images, I'm using a mostly vanilla 3.13-rc mainline kernel. So the details of what I did may well be different..

     

    That said, what you need is the various patches from Louis that were posted earlier in this thread, and apply them to your kernel source, then recompile the kernel and boot it.  If your kernel has a capemgr you use it to load the appropriate device tree overlay. Otherwise, like me, you'll need to incorporate the devicetree changes into a static devicetree file and make u-boot to load it in place of the default.  There are lots of pieces to get right here and it's difficult to explain it exactly as what needs done is very dependant on what kernel, distro and u-Boot versions you have.

     

    I can say that I didn't need any env vars to get ts_calibrate to work.

     

    In /etc/ts.conf the only things I have un-commented are:

    module_raw input
    module pthres pmin=1
    module variance delta=30
    module dejitter delta=100
    module linear

     

    when I ran configure for tslib I used the following

     

    ./configure --prefix=/usr --sysconfdir=/etc

     

    make install puts the various modules in /usr/lib/ts and I find things like input.so dejitter.so pthres.so in that directory.

     

    From the error message you're seeing it would seem that the ts_calibrate can't find input.so. So you probably need to confirm that it's in /usr/local/lib/ts if that's what you're setting TSLIB_PLUGINDIR to.

     

    My particular setup uses /dev/input/event0 and /dev/fb0.  input0 vs input1 probably depends on what order the drivers load in.

    I see input devices in dmesg as follows:

     

    [0.799351] input: ti-tsc as /devices/ocp.3/44e0d000.tscadc/TI-am335x-tsc/input/input0
    [1.415102] input: bb_view_gpio_keys.8 as /devices/bb_view_gpio_keys.8/input/input1
    [2.886874] input: HID 04d9:1400 as /devices/ocp.3/47400000.usb/47401c00.usb/musb-hdrc.1.auto/usb2/2-1/2-1:1.0/0003:04D9:1400.0001/input/input2
    [2.901554] hid-generic 0003:04D9:1400.0001: input,hidraw0: USB HID v1.10 Keyboard [HID 04d9:1400] on usb-musb-hdrc.1.auto-1/input0
    [2.928650] input: HID 04d9:1400 as /devices/ocp.3/47400000.usb/47401c00.usb/musb-hdrc.1.auto/usb2/2-1/2-1:1.1/0003:04D9:1400.0002/input/input3
    [2.942749] hid-generic 0003:04D9:1400.0002: input,hidraw1: USB HID v1.10 Mouse [HID 04d9:1400] on usb-musb-hdrc.1.auto-1/input1

     

    (apologies for the daft formatting, the editor forces the above to be a table when pasted in, see  http://www.element14.com/community/thread/31978/l/how-do-i-un-table-pasted-text )

     

    In my kernel .config I have

     

    CONFIG_FRAMEBUFFER_CONSOLE=y
    CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y

     

    but my kernel commandline only has

     

    console=ttyO0,115200n8 root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait

     

    so the boot messages only go to ttyO0 not to the LCD

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

    Hello,

     

    Thanks for your help^^

     

    well I used your ./configure --prefix=/usr --sysconfdir=/etc command line and now ts_calibrate works "a little"..

     

    I still have an issue, when I execute ts_calibrate I've got this message:

    tslib: selected device is not a touchscreen (must support ABS and Key event types)

    but it takes samples and write calibrations constant (with bad values) in pointercal.

     

    my ti-tsc is input1 and bb_view_gpio_keys is input4

     

    Can you tell me what have you got in pointercal please? (I'll try to force it "by hand"..)

     

    I saw this on the web, http://stackoverflow.com/questions/11937287/touchscreen-and-driver-installed-but-tslib-cannot-calibrate

    someone advise to modify the source code like this:

    input_dev = input_allocate_device();
    [..]
    set_bit(EV_ABS, input_dev->evbit);
    set_bit(EV_KEY, input_dev->evbit);

     

    But it seems that it doesn't work..

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

    If yours in input1 then perhaps you need to export TSLIB_TSDEVICE with something appropriate ?

     

    My /etc/pointercal with a BB-View-4.3 is

     

    -8179 -5 32323404 11 -5081 18944446 65536 480 272

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

    Thanks for your answer, maybe I have a clue :

     

    For the moment, I compiled tslib directly on the beagleboard.. Maybe should I compile it on my PC desktop with the same cross compile chain that I used to compile the kernell..?

     

     

    Edit: well I compiled it on my PC desktop with the cross tool chain :

    ./configure --prefix=/usr --sysconfdir=/etc

    make ARCH=arm CROSS_COMPILE=/home/ana/Téléchargements/BBB/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-

     

    and copy all files in the "good" directories on the BBB . I mean all needed *.la and *.so in /usr/lib/ts and the all needed binaries like _s_calibrate in /usr/bin .. and I copy also tslib directory with source files (with all *.o thats also seems to be needed) .,


    and now I have this error message:

    ts_calibrate.o: file not recognized: File format not recognized

    collect2: ld return 1 exit statutsn


    It's really a pain to make this works ... Well I think I will stop with my Ubuntu file system and try the [How-to] of this post... I'm really confused because I don't understand what I'm doing wrong...

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

    IMHO cross compiling is always a bad idea, it's notoriously hard to get it right.  I natively compile all my code.

     

    Anyway, your problem is likely to be that you didn't tell ./configure that you're cross compiling so it created makefiles for compiling on the host instead.  ARCH=arm CROSS_COMPILE= are things that the kernel build system knows how to handle. Nothing that I can see in the tslib sources uses either of those environment vars.

     

    ./configure --help has this:

    --host=HOST   cross-compile to build programs to run on HOST [BUILD]

    so if you really must cross compile, you'll have to work out exactly what to pass to configure using that option as a start. You may also need to set CC to your cross compiler.  Even then, it may not work as configure often tries to compile and run small pieces of code while testing for features. Getting those Arm-compiled tests to run on your x86 system isn't impossible, but it's an extra challenge. 

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

    Hello selsinork,

     

    Thanks for your answer ^^

    well I tried a cross-compile of tslib  just because my natively compiled on the BBB wasn't working...

     

    I understand what you mean by passing options to configure.. I'll try to do this..  (just to be clearer, I'm not trying to run on an x86, but just to compile on it and run it on the BBB)

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

    Hello again,

     

    Well I managed to cross compile tslib, but I've got exactly the same problem than with the native compile.

     

    So I think that maybe the problems comes from my *dtb  file because I took the Angstrom ones (I didn't compiled them like I did with the kernell)...  (I've just discovered dtb files, so I'm a little bit disapointed with it.. )

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

    Hello again,

     

    Well I managed to cross compile tslib, but I've got exactly the same problem than with the native compile.

     

    So I think that maybe the problems comes from my *dtb  file because I took the Angstrom ones (I didn't compiled them like I did with the kernell)...  (I've just discovered dtb files, so I'm a little bit disapointed with it.. )

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

    Devicetree has been a painful experience for a lot of us, however since they're used to describe what hardware is present it's important to get them right.  On the BBB, depending on which kernel you're using, you'll also have the added challenge of device tree overlays (*.dtbo files).

    While the idea behind overlays could be an interesting one, I've personally come to the conclusion that overlays are unnecessary and mostly just an added complexity. For the large majority of people who will struggle with normal device tree stuff, overlays just are not helpful at all, they're just another barrier.

    • 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