- Finally, I proceed with the creation of the SDcard image, and here the problems begin. I started with the paragraph “Creating SD Card Image Using Provided Script”. The guide, as I read, presents details on how to create the gsrd bootable sd card image, similar with the sd card image that is provided as part of the precompiled binaries package. The tool used is make_sdimage.py.
Of the files required, I cannot find the one indicated as “u-boot-arria5.img: U-boot image, Compiled by Yocto with bitbake virtual/bootloader” and the problem is probably related to the recompilation of the kernel.
Now the guide offers two possibilities:
1. Creating SD Card Image Using Prebuilt Binaries: this section presents how to use the script to create the Cyclone V SD Card by using the prebuilt binaries.
In this case the instructions I run are:
Download the binaries into the home folder and extract them, and cd to the binaries folder:
cd ~
mkdir linux-socfpga-gsrd-17.1-cv-bin
# 17.1
wget
https://releases.rocketboards.org/release/2017.10/gsrd/bin/linux-socfpga-gsrd-17.1std-cv.tar.gz tar -xvzf linux-socfpga-gsrd-17.1std-cv.tar.gz -C linux-socfpga-gsrd-17.1-cv-bin
Download the script and the webserver contents archive into the current folder:
cd ~
# 17.1
wget
http://releases.rocketboards.org/release/2017.10/gsrd/tools/make_sdimage.py chmod +x ~/make_sdimage.py
Create the root filesystem to be put on the SD card image:
cd ~/linux-socfpga-gsrd-17.1-cv-bin
mkdir rootfs
xz -d gsrd-console-image-cyclone5.tar.xz
sudo tar xf gsrd-console-image-cyclone5.tar -C rootfs
Copy u-boot.scr in the working folder
cd ~
cp u-boot.scr ~/linux-socfpga-gsrd-17.1-cv-bin
Call the make_sdimage.py script:
cd ~/linux-socfpga-gsrd-17.1-cv-bin
sudo ~/make_sdimage.py
-f
-P preloader-mkpimage.bin,u-boot-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
Now, the image is created, but when I run it on the Devkit, it gets stuck with the following
U-Boot SPL 2013.01.01 (Nov 01 2017 - 07:15:02)
BOARD : Altera SOCFPGA Cyclone V Board
CLOCK: EOSC1 clock 25000 KHz
CLOCK: EOSC2 clock 25000 KHz
CLOCK: F2S_SDR_REF clock 0 KHz
CLOCK: F2S_PER_REF clock 0 KHz
CLOCK: MPU clock 925 MHz
CLOCK: DDR clock 400 MHz
CLOCK: UART clock 100000 KHz
CLOCK: MMC clock 50000 KHz
CLOCK: QSPI clock 370000 KHz
RESET: COLD
INFO : Watchdog enabled
SDRAM: Initializing MMR registers
SDRAM: Calibrating PHY
SEQ.C: Preparing to start memory calibration
SEQ.C: CALIBRATION PASSED
SDRAM: 1024 MiB
SDRAM: Initializing SDRAM ECC
SDRAM: ECC initialized successfully with 1589 ms
SDRAM: ECC Enabled
ALTERA DWMMC: 0
U-Boot 2013.01.01-00138-g239ae4d (Oct 31 2017 - 10:12:21)
CPU : Altera SOCFPGA Platform
BOARD : Altera SOCFPGA Cyclone V Board
I2C: ready
DRAM: 1 GiB
MMC: ALTERA DWMMC: 0
*** Warning - bad CRC, using default environment
In: serial
Out: serial
Err: serial
Net: mii0
Hit any key to stop autoboot: 0
reading u-boot.scr
128 bytes read in 3 ms (41 KiB/s)
# # Executing script at 02000000
Wrong image format for "source" command
reading zImage
4099440 bytes read in 189 ms (20.7 MiB/s)
reading socfpga.dtb
25180 bytes read in 5 ms (4.8 MiB/s)
# # Flattened Device Tree blob at 00000100
Booting using the fdt blob at 0x00000100
Loading Device Tree to 03ff6000, end 03fff25b ... OK
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Linux version 4.1.33-ltsi-altera (esv@eswdmz3) (gcc version 5.2.1 20151005 (Linaro GCC 5.2-2015.11-2) )# 1 SMP Tue Oct 31 10:09:29 MYT 2017
[ 0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=10c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine model: Altera SOCFPGA Cyclone V
[ 0.000000] cma: Reserved 16 MiB at 0x3f000000
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] PERCPU: Embedded 12 pages/cpu @eefc8000 s19712 r8192 d21248 u49152
[cut] [ 2.588630] Freeing unused kernel memory: 424K (c07ca000 - c0834000)
[ 2.777810] systemd[1]: Failed to insert module 'autofs4': No such file or directory
[ 2.794851] systemd[1]: systemd 226 running in system mode. (+PAM -AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT +GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD +IDN)
[ 2.813148] systemd[1]: Detected architecture arm.
Welcome to The Ångström Distribution v2015.12!
[ 2.841796] Unhandled fault: imprecise external abort (0x406) at 0x8f97e2f7
[ 2.848729] pgd = ee068000
[ 2.851423] [8f97e2f7] *pgd=00000000
[ 2.860516] systemd[1]: Caught <BUS>, dumped core as pid 692.
[ 2.866449] systemd[1]: Freezing execution.
And I cannot explain what happens: probably there is no correspondence from what is described in the device tree and what the kernel expects.
continue...