Yocto and SAMA5D3-XPLAINED NOOB confusion

Moderator: nferre

Posts: 3
Joined: Wed Mar 23, 2016 3:54 pm

Yocto and SAMA5D3-XPLAINED NOOB confusion

Wed Mar 23, 2016 5:42 pm

I am trying to build Yocto and to run the result on a SAMA5D3-XPLAINED board. This is all new to me, so I am learning as I go.

I got quit far
1) Out of the box
- I can login to whatever is running on the board
- SAM-BA can talk to the board
- I downloaded demo linux4sam-poky-sama5d3_xplained-5.2, copied it onto a SD card and see that the environment is different when booting with or without the SD card.
2) Building things myself
- Yocto has built core-image-minimal (it doesn't build atmel-qt5-demo-image, but that is another issue for another day). The same also builds for running under qemu and while that works, the details are hidden by the 'runqemu' command that is created when the target is qemux86.

The challenge is: Yocto builds on a server (Centos-7; 4 core/32GB RAM/2TB disk); SAM-BA runs within a VM (Ubuntu; 6 core/4 GB RAM/64 GB disk); My main OS, where I overwrite the SD Card is MacOSX

My goal is to have the result of the Yocto project on the board. There are two ways: SD card (preferable) or SAM-BA, either NAND or SDRAM.

My confusion is what exactly should be copied from the Yocto project (running on the server and sitting at several GB) to my VM for SAM-BA or to my Mac to copy onto the SD card.

When I do

Code: Select all

  ls tmp/deploy/images/sama5d3-xplained/
I get a whole bunch of files and I am confused as to use which file where.

Code: Select all

-rw-r--r--. 1 ewalet ewalet   32K Mar 23 10:26 atmel-qt5-demo-image-sama5d3-xplained-20160323093145.rootfs.manifest
-rw-r--r--. 1 ewalet ewalet  136M Mar 23 10:26 atmel-qt5-demo-image-sama5d3-xplained-20160323093145.rootfs.tar.gz
-rw-r--r--. 1 ewalet ewalet  192M Mar 23 10:26 atmel-qt5-demo-image-sama5d3-xplained-20160323093145.rootfs.ubi
-rw-r--r--. 1 ewalet ewalet  186M Mar 23 10:26 atmel-qt5-demo-image-sama5d3-xplained-20160323093145.rootfs.ubifs
-rw-r--r--. 1 ewalet ewalet   857 Mar 23 09:26 core-image-minimal-sama5d3-xplained-20160323085600.rootfs.manifest
-rw-r--r--. 1 ewalet ewalet  2.2M Mar 23 09:26 core-image-minimal-sama5d3-xplained-20160323085600.rootfs.tar.gz
-rw-r--r--. 1 ewalet ewalet  5.0M Mar 23 09:26 core-image-minimal-sama5d3-xplained-20160323085600.rootfs.ubi
-rw-r--r--. 1 ewalet ewalet  4.7M Mar 23 09:26 core-image-minimal-sama5d3-xplained-20160323085600.rootfs.ubifs
-rw-rw-r--. 2 ewalet ewalet 1003K Mar 23 09:13 modules--4.1+git0+cfc111e09a-r0-sama5d3-xplained-20160323085600.tgz
-rw-r--r--. 2 ewalet ewalet   294 Mar 23 10:25 README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt
-rwxr-xr-x. 2 ewalet ewalet   15K Mar 23 09:18 sama5d3_xplained-nandflashboot-uboot-3.8.4.bin
-rw-r--r--. 1 ewalet ewalet   226 Mar 23 10:26 ubinize.cfg
-rwxr-xr-x. 2 ewalet ewalet  438K Mar 23 09:18 u-boot-sama5d3-xplained-v2015.01-at91-r0.bin
-rw-r--r--. 2 ewalet ewalet   34K Mar 23 09:13 zImage--4.1+git0+cfc111e09a-r0-at91-sama5d3_xplained-20160323085600.dtb
-rw-r--r--. 2 ewalet ewalet   36K Mar 23 09:13 zImage--4.1+git0+cfc111e09a-r0-at91-sama5d3_xplained_pda4-20160323085600.dtb
-rw-r--r--. 2 ewalet ewalet   36K Mar 23 09:13 zImage--4.1+git0+cfc111e09a-r0-at91-sama5d3_xplained_pda7-20160323085600.dtb
-rw-r--r--. 2 ewalet ewalet   36K Mar 23 09:13 zImage--4.1+git0+cfc111e09a-r0-at91-sama5d3_xplained_pda7b-20160323085600.dtb
-rw-r--r--. 2 ewalet ewalet  3.4M Mar 23 09:13 zImage--4.1+git0+cfc111e09a-r0-sama5d3-xplained-20160323085600.bin
I filtered out the links, but if that floats your boot (<- not a typo, sorry)

Code: Select all

at91bootstrap.bin -> sama5d3_xplained-nandflashboot-uboot-3.8.4.bin
at91bootstrap-sama5d3_xplained.bin -> sama5d3_xplained-nandflashboot-uboot-3.8.4.bin
atmel-qt5-demo-image-sama5d3-xplained.manifest -> atmel-qt5-demo-image-sama5d3-xplained-20160323093145.rootfs.manifest
atmel-qt5-demo-image-sama5d3-xplained.tar.gz -> atmel-qt5-demo-image-sama5d3-xplained-20160323093145.rootfs.tar.gz
atmel-qt5-demo-image-sama5d3-xplained.ubi -> atmel-qt5-demo-image-sama5d3-xplained-20160323093145.rootfs.ubi
BOOT.BIN -> sama5d3_xplained-nandflashboot-uboot-3.8.4.bin
core-image-minimal-sama5d3-xplained.manifest -> core-image-minimal-sama5d3-xplained-20160323085600.rootfs.manifest
core-image-minimal-sama5d3-xplained.tar.gz -> core-image-minimal-sama5d3-xplained-20160323085600.rootfs.tar.gz
core-image-minimal-sama5d3-xplained.ubi -> core-image-minimal-sama5d3-xplained-20160323085600.rootfs.ubi
modules-sama5d3-xplained.tgz -> modules--4.1+git0+cfc111e09a-r0-sama5d3-xplained-20160323085600.tgz
u-boot.bin -> u-boot-sama5d3-xplained-v2015.01-at91-r0.bin
u-boot-sama5d3-xplained.bin -> u-boot-sama5d3-xplained-v2015.01-at91-r0.bin
zImage -> zImage--4.1+git0+cfc111e09a-r0-sama5d3-xplained-20160323085600.bin
zImage-at91-sama5d3_xplained.dtb -> zImage--4.1+git0+cfc111e09a-r0-at91-sama5d3_xplained-20160323085600.dtb
zImage-at91-sama5d3_xplained_pda4.dtb -> zImage--4.1+git0+cfc111e09a-r0-at91-sama5d3_xplained_pda4-20160323085600.dtb
zImage-at91-sama5d3_xplained_pda7b.dtb -> zImage--4.1+git0+cfc111e09a-r0-at91-sama5d3_xplained_pda7b-20160323085600.dtb
zImage-at91-sama5d3_xplained_pda7.dtb -> zImage--4.1+git0+cfc111e09a-r0-at91-sama5d3_xplained_pda7-20160323085600.dtb
zImage-sama5d3-xplained.bin -> zImage--4.1+git0+cfc111e09a-r0-sama5d3-xplained-20160323085600.bin
I usually work with Linux server farms or with a bunch of VM's doing dev and devops and there the boot process is outside my normal scope. Working with a board is new (and very interesting)

Can someone help me lift my confusion? Is there a script that I can run that will create a diskimage for my SAMA board?
I'd rather not overwrite the NAND and have the board (temporarily) unusable (although I should be able to make a backup of the contents first)

Most tutorials about Yocto only go as far as the build process itself and few are specific for the board I have. I have only a faint and confused idea of what to do next.

Any help is appreciated, even a link or a book suggestion (I already have "Learning Embedded Linux Using the Yocto Project"). I think I only need to understand what files go where. I should be able to figure out the "why" myself.

Thanks in advance.

Posts: 20
Joined: Mon Jul 27, 2015 4:27 pm

Re: Yocto and SAMA5D3-XPLAINED NOOB confusion

Wed Mar 23, 2016 6:17 pm

It seems you asked Yocto to build images for nandflash.
So you will need :
core-image-minimal-sama5d3-xplained-20160323085600.ubi (Your file system for nand flash)
zImage--4.1+git0+cfc111e09a-r0-at91-sama5d3_xplained-20160323085600.dtb (Your device tree)
zImage--4.1+git0+cfc111e09a-r0-sama5d3-xplained-20160323085600.bin (Your zImage Kernel)
sama5d3_xplained-nandflashboot-uboot-3.8.4.bin (the first stage bootloader)
u-boot-sama5d3-xplained-v2015.01-at91-r0.bin (U-boot)

All theses files must be loaded with SAM-BA

If you want to boot from SD card you need to re-run Yocto and tells him to build an image for SD card.

Then you will need :

core-image-minimal-sama5d3-xplained-20160323085600.rootfs.tar.gz (Your file system to untar into rootfs partition of SD card)

zImage--4.1+git0+cfc111e09a-r0-at91-sama5d3_xplained-20160323085600.dtb (Your device tree)
zImage--4.1+git0+cfc111e09a-r0-sama5d3-xplained-20160323085600.bin (Your zImage Kernel)
sama5d3_xplained-sdcardboot-uboot-3.8.4.bin (the first stage bootloader for sdcard)
u-boot-sama5d3-xplained-v2015.01-at91-r0.bin (U-boot)

Have a look there for details : linux4sam/bin/view/Linux4SAM/Sama5d3XplainedMainPage

Posts: 3
Joined: Wed Mar 23, 2016 3:54 pm

Re: Yocto and SAMA5D3-XPLAINED NOOB confusion

Wed Mar 23, 2016 6:53 pm

Thank you, that was quite a fast response.

Naming each of the files and the link to the page helps. (I had seen the page, but since I had trouble getting email conformation for download to download SAM-BA till this morning, I forgot about the details since I had focussed on building other projects with Yocto, like openwrt)

I won't be able to act on your response anywhere near as fast. It is the end of the day here and tomorrow I have a day with a customer and a long commute there.

I was not aware that the settings were specific for nandflash, but that will be a good first start. I'll certainly go that way first.

If anyone can point me to some information on building for an sd card, that would be helpful in the future.

Thanks again. I should be able to move forward.

Posts: 20
Joined: Mon Jul 27, 2015 4:27 pm

Re: Yocto and SAMA5D3-XPLAINED NOOB confusion

Thu Mar 24, 2016 10:35 am

If anyone can point me to some information on building for an sd card, that would be helpful in the future.
As I remember, you need to change your variable UBOOT_MACHINE.
Either hack the meta-atmel/conf/machime/sama5d3-xplained.conf file (But this is not a recommended way).
Or create a bbappend file to append the U-boot recipe file in meta-atmel and overwrite the value of UBOOT_MACHINE.

You must set UBOOT_MACHINE = "sama5d3_xplained_mmc_config" to get image for SD card.

New U-boot and bootstrap will be located at tmp/deploy/images/sama5d3-xplained/.
Posts: 3
Joined: Wed Mar 23, 2016 3:54 pm

Re: Yocto and SAMA5D3-XPLAINED NOOB confusion

Mon Mar 28, 2016 10:39 pm

I can't say that I completely understand it, nor that I am where I want to be, but I am getting closer.

I definately do not want to flash the NAND as long as I can not make a bootable disk. The reason is that recovering from a bad disk is just to insert another one whereas with a corrupted NAND I have no idea how to quickly recover.

What I did.

First, I set the machine to sama5d3-xplained-sd (notice the added -sd) and through Hob I learned that I could now create an ext3 image. (I spent a *lot* of time with Toaster, but that seems to be vaporware going on abandonware; all issues I run into with Toaster have discussions that are more than two years old. Toaster itself seems to be toast; it just can't build anything but the simplest projects. I wonder how much it is actually used to create projects). However, I could not yet create an iso image.

Second, after building Yocto for Raspberry-pi and seeing that it does make the kind of disk images I am after, I borrowed some code from the raspberry-pi layer to create an disk image for the atmel-layer. I now have a usable disk, but not a bootable one. When I reuse the items from the boot partition of the image linux4sam-poky-sama5d3_xplained-5.2 that I downloaded (but keep the items of the primary partition from m own build), I can make the disk bootable.
This was an interesting exercise as, because of some errors I made at first, it showed me how to find debugging info of the build process and I understand bitbake a little better.

If I can get the right files with the right names to the boot partition, I should be where I want to be. I now need to focus on why the boot partition the way I create it does not, well, boot.

I played around with the Yocto project on my eval-board for a while and what the meta-atmel build offers is already interesting. Can't wait to actually add stuff.

Anyway, I won't have much time the remainder of this week, so I have to wait to pick this up again.

Return to “SAMA5-based”

Who is online

Users browsing this forum: No registered users and 6 guests