USB mass storage on Gumstix – a tricky issue using Yocto Daisy

A recent upgrade of Yocto, from Dora to Daisy, broke the things worked before. Actually, CONFIG_USB_MASS_STORAGE, enabled in the defconfig of the Overo, was not passed to the .config during the kernel build. This weird missing config costed me 24-hour debugging. And it turns out nobody was doing wrong but bitbake could do better indeed. This post talks about building Gumstix image using Yocto Daisy, the missing kernel config, and debug and the take away in the summary. Happy debug!

0. Build the Gumstix Overo image using Yocto Daisy

The Gumstix-Yocto-Repo now uses Yocto Daisy as the default/master branch for its recipes. Before following the gumstix-yocto building procedure, we have to update the Yocto into Daisy:
0.0. Quick Start
http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html
0.1. Download the SDK
https://www.yoctoproject.org/download/yocto-project-16-buildtools-sdk
0.2. Download the toolchain (for 1.6)
http://downloads.yoctoproject.org/releases/yocto/yocto-1.6/toolchain/
0.3. Gumstix-Yocto
https://github.com/gumstix/Gumstix-YoctoProject-Repo
0.4. Check the Yocto version before build (make sure Daisy is invoked instead of others, like Dora)
cat poky/meta-yocto/conf/distro/poky.conf

1. The missing config – CONFIG_USB_MASS_STORAGE

Before “bitbake gumstix-consle-image” is submitted, the new config CONFIG_USB_MASS_STORAGE is enabled as a module in the defconfig of the Overo kernel recipe. Then weird thing happened. The USB mass storage kernel module was not contained in the modules.tgz. Actually, it had never been built.

2. Debug

While the kernel source code locates within the git directory under build/tmp/work/overo-poky-linux-gnueabi/linux-gumstix/3.5.7-r0, the building directory is linux-overo-standard-build under the same directory. Checking the .config for the previous build, I found no config for the USB mass storage was enabled. A direct doubt was something wrong with the bb file, as “bitbake -f -c virtual/kernel” triggers the parsing of “poky/meta-gumstix/recipes-kernel/linux/linux-gumstix_3.5.7.bb“. And the parse was good because the defconfig was located under /tmp/work/overo-poky-linux-gnueabi/linux-gumstix/3.5.7-r0, as well as bunch of patch files. After hours and hours debugging, “bitbake -v -D -f -c virtual/kernel” showed the clue:

GEN     /home/daveti/gumstix-daisy/yocto/build/tmp/work/overo-poky-linux-gnueabi/linux-gumstix/3.5.7-r0/linux-overo-standard-build/Makefile
scripts/kconfig/conf –silentoldconfig Kconfig
.config:2751:warning: override: USB_CDC_COMPOSITE changes choice state
#
# configuration written to .config
#
GEN     /home/daveti/gumstix-daisy/yocto/build/tmp/work/overo-poky-linux-gnueabi/linux-gumstix/3.5.7-r0/linux-overo-standard-build/Makefile

The kernel config checking tool ‘conf’ reported an warning about a config conflict and a config rewriting because of this conflict. After disabling CONFIG_USB_CDC_COMPOSITE in the defconfig, we now have the USB mass storage kernel module.

3. Summary

CONFIG_USB_CDC_COMPOSITE was disabled in the Dora recipes but is enabled in the Daisy recipes for certain reasons. The bug could be found easily by normal “make menuconfig” as it is reported as a warning. However, bitbake silences the warning and makes everything look well even if the .config has been rewritten because of some config conflict.

About daveti

Interested in kernel hacking, compilers, machine learning and guitars.
This entry was posted in Embedded System, Linux Distro and tagged , , , , , , . Bookmark the permalink.

2 Responses to USB mass storage on Gumstix – a tricky issue using Yocto Daisy

  1. What’s up, just wanted to mention, I loved this article.

    It was practical. Keep on posting!

  2. fresatrice says:

    It’s amazing to pay a quick visit this web site and reading the
    views of all friends concerning this piece of writing,
    while I am also keen of getting knowledge.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s