Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
11 years ago

Failing to create SD card image of Angstrom Linux for Altera SoCrates (Cyclone V)

Failing to create SD card image of Angstrom Linux for Altera SoCrates (Cyclone V)

summary

Using supplied SD card images I can (unsurprisingly) program an SD card which boots happily on the Altera SoCrates dev board.

I have so far failed to build/generate an SD image for Angstrom for Altera SoCrates which successfully boots.

details

Using supplied images:

Angstrom (2014.06) image has two partitions:

$ sudo udevadm info -q all -n /dev/mmcblk0p1

S: disk/by-id/mmc-SA08G_0x1f6caf0e-part1

E: DEVLINKS=/dev/disk/by-id/mmc-SA08G_0x1f6caf0e-part1

E: DEVNAME=/dev/mmcblk0p1

E: ID_PART_ENTRY_TYPE=0xa2

$ sudo udevadm info -q all -n /dev/mmcblk0p2

S: disk/by-id/mmc-SA08G_0x1f6caf0e-part2

S: disk/by-label/rootfs

E: DEVLINKS=/dev/disk/by-id/mmc-SA08G_0x1f6caf0e-part2 /dev/disk/by-label/rootfs /dev/disk/by-uuid/0727d1df-c249-487a-8ad6-c3d1f5fc01b7

E: DEVNAME=/dev/mmcblk0p2

E: ID_FS_LABEL=rootfs

E: ID_FS_LABEL_ENC=rootfs

E: ID_FS_TYPE=ext3

ELDK image has 3 partitions:

$ sudo udevadm info -q all -n /dev/mmcblk0p1

S: disk/by-id/mmc-SL08G_0x616a0011-part1

E: DEVLINKS=/dev/disk/by-id/mmc-SL08G_0x616a0011-part1

E: DEVNAME=/dev/mmcblk0p1

E: ID_PART_ENTRY_TYPE=0xa2

$ sudo udevadm info -q all -n /dev/mmcblk0p2

S: disk/by-id/mmc-SL08G_0x616a0011-part2

E: DEVLINKS=/dev/disk/by-id/mmc-SL08G_0x616a0011-part2 /dev/disk/by-uuid/A931-6EC1

E: DEVNAME=/dev/mmcblk0p2

E: ID_FS_TYPE=vfat

$ sudo udevadm info -q all -n /dev/mmcblk0p3

S: disk/by-id/mmc-SL08G_0x616a0011-part3

E: DEVLINKS=/dev/disk/by-id/mmc-SL08G_0x616a0011-part3 /dev/disk/by-uuid/fc738dbc-dfec-47c0-af6d-f2cfac7b22b3

E: DEVNAME=/dev/mmcblk0p3

E: ID_FS_TYPE=ext3

I have tried two methods to generate my own SD card image:

(1) Use pre-built binaries

http://www.rocketboards.org/foswiki/documentation/gsrd141sdcard

$ cd ~/linux-socfpga-gsrd-14.1-cv-bin

$ sudo ~/make_sdimage.py

-f

-P preloader-mkpimage.bin,u-boot-socfpga_cyclone5.img,num=3,format=raw,size=10M,type=A2

-P rootfs/*,num=2,format=ext3,size=1500M

-P zImage,u-boot.scr,soc_system.rbf,socfpga.dtb,num=1,format=vfat,size=500M

-s 2G

-n sd_card_image_cyclone5.bin

(2) Build all from scratch

http://www.rocketboards.org/foswiki/documentation/angstromonsocfpga_1

Angstrom v2014.06

This appears to complete successfully and the following files are created:

Angstrom-console-image-eglibc-ipk-v2014.06-socfpga_cyclone5.rootfs.cpio

Angstrom-console-image-eglibc-ipk-v2014.06-socfpga_cyclone5.rootfs.ext3

Angstrom-console-image-eglibc-ipk-v2014.06-socfpga_cyclone5.rootfs.manifest

Angstrom-console-image-eglibc-ipk-v2014.06-socfpga_cyclone5.rootfs.tar.xz

console-image-socfpga_cyclone5.cpio

console-image-socfpga_cyclone5.ext3

console-image-socfpga_cyclone5.manifest

console-image-socfpga_cyclone5.tar.xz

file_list.txt

modules--3.10-r1.2-socfpga_cyclone5-20141222135550.tgz

modules--3.15-r1.2-socfpga_cyclone5-20141222105845.tgz

modules-socfpga_cyclone5.tgz

README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt

socfpga_arria5-20141222135550.dtb

socfpga_arria5.dtb

socfpga_arria5_socdk-20141222105845.dtb

socfpga_arria5_socdk.dtb

socfpga_cyclone5-20141222135550.dtb

socfpga_cyclone5.dtb

socfpga_cyclone5_socdk-20141222105845.dtb

socfpga_cyclone5_socdk.dtb

socfpga_vt-20141222105845.dtb

socfpga_vt-20141222135550.dtb

socfpga_vt.dtb

u-boot-socfpga_cyclone5

u-boot-socfpga_cyclone5-2013.01.01-r0

u-boot-socfpga_cyclone5-2013.01.01-r0.bin

u-boot-socfpga_cyclone5-2013.01.01-r0.img

u-boot-socfpga_cyclone5.bin

u-boot-socfpga_cyclone5.img

u-boot-spl-socfpga_cyclone5

u-boot-spl-socfpga_cyclone5-2013.01.01-r0

u-boot-spl-socfpga_cyclone5-2013.01.01-r0.bin

u-boot-spl-socfpga_cyclone5.bin

vmlinux

vmlinux-3.10-r1-socfpga_cyclone5-20141222135550

vmlinux-3.15-r1-socfpga_cyclone5-20141222105845

zImage

zImage--3.10-r1.2-socfpga_cyclone5-20141222135550.bin

zImage--3.15-r1.2-socfpga_cyclone5-20141222105845.bin

zImage-socfpga_cyclone5.bin

*** problems/questions ***

(1) Using the pre-built binaries the SD created does not boot correctly on the Altera SoCrates board.

I suspect it is an issue with the dtb or perhaps it wasn't built for the SoCrates (the dtb file is socfpga.dtb not socfpga_socrates.dtb)

Am I missing something?

(2) Using the files built from scratch I can't see which files relate to the ones required for an SD image.

How do I go from this to a SD card?

(3) The working Angstrom and ELDK SD cards have a different number of partitions.

I can't see what is on the 0xA2 Angstrom partition to see what files have been used.

Any ideas on how I might view the contents of the 0xA2 partition?

references

http://www.rocketboards.org/foswiki/documentation/angstromonsocfpga_1

http://www.rocketboards.org/foswiki/documentation/gsrd141sdcard

http://www.rocketboards.org/foswiki/documentation/gsrd141releasenotes

(and the rest of the web through generic search engines to no avail)

thanks

Apologies in advance for any duplication or failure to adhere to forum rules, but I have tried to be as thorough as possible.

Any help or suggestions will be gratefully received.

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    eehh..., nobody loves you siclone not even one answerd to your question. i am investigating the same thing. firstly, from what i suspect you must have 2 partitions on your sd card. and by some secret it turns out that both must be primary drives. none of them should be logical. you can create those by mini tool partition wizard. secondly, handbook tells us that

    "The SD/MMC flash has a MBR that points to a specific offset at the start of the partition. The partition is of type 0xA2, a custom raw partition type without any file system. The preloader image tool always places the output image at the start of the output binary file, regardless of the target flash memory type"

    from this, we may assume that your micro sd Partition 1 should simply have all zeroes all over the place. without formatting. without any file sistem nor ex2 not fat just nothing. and we may assume that sd you are having has similar content inside. and there is no viewer which will let you to view contents of unformatted drive (at least from what i know)... tried few hex viewers all of them went crazy.

    by mini tool partition wizard you can create small partition without any format and fill it by zeroes then change the partition ID of that partition to 0xa2. you will find all the necessary tools in that software i suggested. then create second partition with fat 32 (or ex2 in case of linux ). your preloader will be uploaded to that crazy first partition and u boot will get into fat partition by using these tools "SD Card Boot Utility" and "Preloader Image Tool" both of which are built into EDS command shell which you will find in c:\altera\<whatever version you have>\embedded folder . and after some magic woodo commands that are described in this document https://www.altera.com/en_us/pdfs/literature/ug/ug_soc_eds.pdf you may or may not succeed in your goal heh... i am stuck exactly here. so tell me if you will find my help useful and share your experience as well .

    everythiong i wrote here are purely my assumptions and suspicions so i may very easily be wrong in something. you'l find some intriguingly interesting information about QSPI Flash on this post http://www.alteraforum.com/forum/showthread.php?t=42412&page=2&highlight=preloader+partition

    (by the way, i also am messing with SoCrates :))) )