[SOLVED] Adding framebuffer support

#1

Hey there,

I’m planning to attach a display to a MangOH Red via SPI (an Adafruit ILI9341 to be exact).
I wonder now what’s the best way to go about it. In the best case I’d like to have framebuffer support for it (i.e. have a /dev/fb0). There are drivers for the display I use, but they fail to load since the kernel coming with 18.10.3 is compiled without any framebuffer support at all (which is why the driver fails to load):

$ cat /proc/kallsyms | grep register_framebuffer | wc -l
0

Do you think it’s worth the hassle to compile an own kernel/image via yocto and all that comes with it or should I just go for interfacing with the display via SPI? If so, I guess I would need to port some Arduino library.


For reference, there is also this guide, but it fails for me on the bitbake linux-yocto -c kernel_configme -f step with this message:

WARNING: No bb files matched BBFILE_PATTERN_swi-mdm9xxx-bin '^/dist/yocto/meta-swi/../meta-swi-extras/meta-swi-mdm9xxx-bin/'
WARNING: No bb files matched BBFILE_PATTERN_swi-mdm9xxx-bin '^/dist/yocto/meta-swi/../meta-swi-extras/meta-swi-mdm9xxx-bin/'
ERROR: Nothing PROVIDES 'linux-yocto'
ERROR: linux-yocto was skipped: incompatible with machine swi-mdm9x28 (not in COMPATIBLE_MACHINE)
ERROR: linux-yocto was skipped: incompatible with machine swi-mdm9x28 (not in COMPATIBLE_MACHINE)
ERROR: linux-yocto was skipped: incompatible with machine swi-mdm9x28 (not in COMPATIBLE_MACHINE)

Edit: I see there’s some sort of mismatch in the machine name:

yocto/build_bin$ grep COMPATIBLE_MACHINE  ../meta-swi/meta-swi-mdm9x15/recipes-kernel/linux/linux-yocto_3.14.bb
COMPATIBLE_MACHINE_swi-mdm9x15 = "swi-mdm9x15"
COMPATIBLE_MACHINE_swi-mdm9x15 = "(swi-mdm9x15)"
yocto/build_bin$ grep 'MACHINE' conf/local.conf | grep -v '#'
MACHINE = "swi-mdm9x28-wp"

Can this be right? Is linux-yocto even the right target?

#2

Hi c.pahl,
Please try to use bitbake linux-quic -c menuconfig -f command instead of bitbake linux-yocto -c kernel_configme -f command to cross that error

Thanks,
Thong

#3

Hello @Thong,

thank you for your answer.
After some more tinkering I have build an image with the following command:

# We only want to re-build the linux image,
# no need to 
export LEGATO_BUILD=0
# Build the base installation:
make image_bin
# Source the build tools:
. ./poky/oe-init-build-env ./build_bin
# Set linux config / enable framebuffer etc.:
# (See also https://bugzilla.yoctoproject.org/show_bug.cgi?id=2256#c7)
bitbake linux-quic -c cleansstate
# For framebuffer support enable:
# Drivers options -> Graphic drivers -> Framebuffer Support.
# (and whatever else you'd like to)
# Hint to myself: do not save the config somewhere else or it won't be used.
# Just exit menuconfig with a "yes" to save.
bitbake linux-quic -c do_menuconfig -f
bitbake -C compile -f linux-quic
bitbake linux-quic
# Build the image:
bitbake -c cleansstate mdm9x28-image-minimal
bitbake mdm9x28-image-minimal

For some reason I was not able to flush the image via fwupdate:

fwupdate download ~/workspace/legato-dist/yocto/build_bin/tmp/deploy/images/swi-mdm9x28-wp/yocto_wp76xx.4k.cwe
Connecting to service ...
Connecting to service ...
Download started ...
Download successful
Timeout, server 192.168.2.2 not responding.

I was then able to use swiflash to flash the device though:

  • Set dip switch 7 to on
  • Power off device and reboot.
  • Run sudo swiflash -m wp76xx -i ~/workspace/legato-dist/yocto/build_bin/tmp/deploy/images/swi-mdm9x28-wp/yocto_wp76xx.4k.cwe. While this is running, switch the dip 7 off.

So far so good, I can see by uname -v that a newer kernel was build and it indeed has framebuffer support:

$ cat /proc/kallsyms | grep register_framebuffer | wc -l
7

Now on to actually getting drivers to work :slight_smile:

Wiring a Adafruit ILI9341 TFT Display