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 23685 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

    It seems like latest debian image (2014-05-14) doesn't supports "DefaultDepth 24".

    Is there a work-around ?

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

    Luca:

     

    The framebuffer is statically set to 16bpp in the TI LCD driver (tilcdc_drv.c, if you want to track it down). I sent patches to RNelson, which should generally fix the various problems and issues (like statically nailing the framebuffer depth to 16bpp.) I don't have a date for when the next debian binary will appear.

     

    -scooter

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

    Luca:

     

    I can re-generate the patches for you if you're willing to recompile and reinstall your own kernel, using RNelson's linux-dev tree.

     

     

    -scooter

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

    Hi Scott, thanks for your answer and for your help.

    I don't understand very well the problem. In the original post (the compeoree's post) he describe how to fix the color problem by putting "DefaultDepth 24" in xorg configuration. why doesn't it works for me?

    The patch that you can re-generate for me what part of the problem does it solve?

     

    Thanks

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

    Luca:

     

    There are various "depths" by which color is represented. Common values are 8, 16, 24, and 32 bits per pixel (bpp). This is a difference in semantics -- there is bits per pixel how the hardware steps through memory and reads pixels and there is color depth how pixels are represented. So, you can have 32 bits per pixel, where the hardware steps through 32 bit strides in memory when displaying a pixel, but only use 16 bpp color depth, where only 16 bits are used to represent color (most common is 5/6/5 R/G/B bits).

     

    The TI LCD kernel driver statically initializes the framebuffer's color depth to 16 bits per pixel. You can't change it easily. Presumably, you might be able to change it using the 'fbset' command or by recompiling the kernel. There may have been a time when the Xorg configuration "DefaultDepth 24" might have worked, but a 16bpp framebuffer will not allow you to increase the color depth to 24bpp.

     

    The reason why red and black are still swapped is that the element14 cape physically swaps red and black signals in the LCD cape. If you read through the TI AM335X silicon errata, you'll find that red and black are swapped in the 24 bpp color depth -- so, to fix it, element14 swapped the signals and assumed that the kernel's LCD driver initialized the framebuffer to 24 or 32 bpp by default. Except that the driver doesn't initialize to the higher color depth, so you're stuck in the 16bpp color depth looking at physically swapped red/blue with few options to fix the problem.

     

    Confused yet? For the "tl;dr" crowd: element14 probably did the right thing by swapping signals in the device, the TI LCD kernel driver doesn't do the right thing yet.

     

    What I did: I hacked for a couple of days to improve the TI LCD kernel driver. I added the element14 capes to the cape firmware sources. The TI LCD driver understands two flags that will cause the kernel to swap red and black in the color representation (to fix the 16bpp and 24bpp swaps). The TI LCD driver queries the device tree to pick up the requested color depth, which gives you 24bpp color depth for the element14 cape by default via my patches.

     

    Once the kernel with my patches is built and distributed, none of the instructions on this wiki page will be necessary. RNelson accepted them, but I don't know when the new kernel will be distributed.

     

    Things will just work. Batteries included. :-)

     

     

    -scooter

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

    Would be really nice if you could submit those patches to the mainline kernel. Not everyone uses, or wants to use, Roberts stuff.

     

    Reading between the lines, I don't see them moving the default kernel on until they come up with a solution for capemgr in newer kernels. While there's been some progress in that area it still seems to be some way off getting into mainline.

    People are still able to build from Roberts newer stuff - with your patch included - assuming they know it exists and can deal with the issues of no capemgr in an ecosystem that blindly assumes it's presence.

     

    Meanwhile, Louis original instructions here, are now some six months old and the repo he cloned from no longer includes the branch he used.  Things have moved on, the instructions are out of date and really don't work anymore..   With your patch, or a version of it, in mainline these sorts of issues largely disappear and instructions can be provided here that are relatively stable, or at least don't bitrot quite as badly.

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

    Scott, you were very clear! Thanks for the explanation.

    Now it's more clear. I was confused by the fact that "DefaultDepth 24" didn't work for me with the latest Debian image (as the post's title says)...

     

    Is your patches available for me to use and rebuild kernel? Where can I find it?

     

    Thanks.

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

    Is your patches available for me to use and rebuild kernel? Where can I find it?

    Try https://github.com/beagleboard/linux/commit/2cb33ad1b767087899860f8de75c3af901748d99

    • 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:

     

    You're absolutely correct: no capemgr in the 3.15.x branch right now, so the BBB community is "stuck" with 3.8.x. The alternative is to create a customized device tree file that conditionally enables a user's capes. Not optimal, not dynamic, but it would work. It's something I've considered hacking, in between other activities of mine (like managing a research department, having fun with Elvis the Labradoodle and other parts of living life... :-)

     

    Even if capemgr magically showed up in 3.15, there are still parts of the TI board support package (BSP) that would have to migrate, notably all of the 3D accelerator code. Note that the 3D accelerator is a high priority GNU reverse engineering effort that seems to have stalled. Consequently, being "stuck" with 3.8.x is not necessarily as bad as it might seem.

     

     

    -scooter

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

    being stuck on 3.8.x will just become a bigger problem as time goes on. Robert already maintains a huge set of patches which is only going to grow.  I'm sure he has a life away from BBB too, so should he ever decide to give up maintaining things....

     

    I'm fairly sure the SGX gpu code is never going to get into mainline for all sorts of reasons, but it's been my experience that everything else mostly just works as the TI guys have been working away in the background to make that a reality.  The unfortunate part is that BBB has diverged from TIs work enough that moving onwards has become difficult.  You can no longer easily take an overlay from 3.8 and apply it directly to 3.15, too much has changed.

     

    Capes may or may not be a good thing, taking a concept like shields/capes from Arduino and trying to apply it to a much more complex linux/devicetree combination is certainly a much more difficult task.  Betting the farm on capemgr seems likely (hindsight being 20-20) to be the achilles heel of the whole thing - should something useable eventually get into mainline it's never going to be capemgr and whatever differences there are will end up being painful for both users and cape manufacturers alike.

    What I find interesting is that there are many SBC's currently available, RPi, BBB, Cubieboard, OLinuXino, ODroid, Wandboard, Sabre-Lite, RIoTboard and the list goes on. Apart from BBB they all seem to manage just fine without capemgr or any sort of similar thing. So the capemgr concept stands out - by being the focal point for a lot of the pain.

    • 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

    being stuck on 3.8.x will just become a bigger problem as time goes on. Robert already maintains a huge set of patches which is only going to grow.  I'm sure he has a life away from BBB too, so should he ever decide to give up maintaining things....

     

    I'm fairly sure the SGX gpu code is never going to get into mainline for all sorts of reasons, but it's been my experience that everything else mostly just works as the TI guys have been working away in the background to make that a reality.  The unfortunate part is that BBB has diverged from TIs work enough that moving onwards has become difficult.  You can no longer easily take an overlay from 3.8 and apply it directly to 3.15, too much has changed.

     

    Capes may or may not be a good thing, taking a concept like shields/capes from Arduino and trying to apply it to a much more complex linux/devicetree combination is certainly a much more difficult task.  Betting the farm on capemgr seems likely (hindsight being 20-20) to be the achilles heel of the whole thing - should something useable eventually get into mainline it's never going to be capemgr and whatever differences there are will end up being painful for both users and cape manufacturers alike.

    What I find interesting is that there are many SBC's currently available, RPi, BBB, Cubieboard, OLinuXino, ODroid, Wandboard, Sabre-Lite, RIoTboard and the list goes on. Apart from BBB they all seem to manage just fine without capemgr or any sort of similar thing. So the capemgr concept stands out - by being the focal point for a lot of the pain.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
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