8

Background

I was starting to look at using Yocto as a system for building software images for the Raspberry Pi 3 Model B that I have. I wanted to try using Yocto as there are some projects at my office that may begin using it in the future. One of the nice points is that all the setup of cross compilers for your target system is handled by a Yocto layer. There is already a Yocto layer for the Raspberry Pi (meta-raspberrypi) and a custom meta-rpi layer someone has put together with a few more example images.

I need to either cross-compile kernel modules or use Yocto as I have special drivers I wish to add to the Pi. These are already compiled and working on my Ubuntu PC and I hoped using Yocto might make it easy to cross compile these and any other updates in the future.

My difficulty is that the SD Card image talked about in the meta-raspberrypi documentation and several tutorials, never gets generated, even on successful builds.

Tutorials Mentioning The Use Of dd & An .sdimg File

Commonly Seen Error

None of the builds I have made so far generate .sdimg files. When I try to add the sdcard or sdcard_image-rpi image types to IMAGE_FSTYPES I get messages such as:

ERROR: /home/thomasthorne/work/yocto-rpi/meta-raspberrypi/recipes-core/images/rpi-test-image.bb: No IMAGE_CMD defined for IMAGE_FSTYPES entry 'sdcard_image-rpi' - possibly invalid type name or missing support class

Main Questions

How do I generate the SD card image for my Pi from Yocto?

Do I need to format the SD card manually and copy over the contents bit by bit?

Why do all these tutorials suggest it would be as simple as a single dd command? I guess something changed in the last couple of years and they are all out of date.

1 Answer 1

10

For an SD Card image file (similar to the .sdimg ones) to be generated your local.conf file must include the rpi-sdimg filesystem type in the IMAGE_FSTYPE variable. This will typicaly give you a value such as:

IMAGE_FSTYPES = "tar.xz ext3 rpi-sdimg"

With the above parameter included a .rpi-sdimg file will be created during a the build. After a bitbake rpi-test-image the created file for me was tmp/deploy/images/raspberrypi3/rpi-test-image-raspberrypi3.rpi-sdimg.

My thanks to Gary Thomas for pointing this out to me when I asked the same question on the yocto project mailing list. His response to my question can be found in the November 2016 archives.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.