YasuoF
New Contributor
2 years agoLinux fails to boot on DE10-Nano board
Hi,
I try to build a Linux file system for my DE10-Nano board,
I used this (Building Bootloader for Cyclone V and Arria 10 | Documentation | RocketBoard) guide.
When I write sdcard_cv.img to the SD card and power it on, it stops at the following line and Linux does not boot.
[ 1.578872] Synopsys Designware Multimedia Card Interface Driver
What does this log mean?
And how can I fix the problem?
- My working environment is shown below.
Windows 10
Ubuntu 22.04.3 LTS on WSL2
Quartus Prime Version 23.1std.0 Build 991 11/28/2023 SC Standard Edition
- The procedure for creating an sd card image is shown below.
# Create working derectory
cd ~
mkdir de10nano-sample && cd de10nano-sample
# Setup toolchain
tar xf gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf.tar.xz
rm gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf.tar.xz
export PATH=`pwd`/gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf/bin:$PATH
# Get hardware project (Windows)
Download the DE10-Nano CD-ROM (rev.C Hardware) from here (https://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&CategoryNo=167&No=1046&PartNo=4#contents) and unzip the file.
Open Demonstrations/Soc_FPGA/DE10_NANO_SOC_GHRD/DE10_NANO_SoC_GHRD.qpf with Quartus.
Open soc_system.qsys in Platform Designer and generate HDL.
Add soc_system/synthesis/soc_system.qip to the project and Start Compilation.
Copy to a working directory in Ubuntu.
# Get bootloader
cd ~/de10nano-sample
git clone -b socfpga_v2022.04 https://github.com/altera-opensource/u-boot-socfpga
cd u-boot-socfpga/arch/arm/mach-socfpga/cv_bsp_generator
python2 cv_bsp_generator.py \
-i ~/de10nano-sample/DE10_NANO_SoC_GHRD/hps_isw_handoff/soc_system_hps_0 \
-o ~/de10nano-sample/u-boot-socfpga/board/altera/cyclone5-socdk/qts
cd ~/de10nano-sample/u-boot-socfpga
export ARCH=arm
export CROSS_COMPILE=arm-none-linux-gnueabihf-
make socfpga_cyclone5_defconfig
make -j 48
# Get dtb
cd ~/de10nano-sample
cd sopc2dts && sudo apt install default-jdk && make
cd ~/de10nano-sample/DE10_NANO_SoC_GHRD
java -jar ~/de10nano-sample/sopc2dts/sopc2dts.jar \
--input soc_system.sopcinfo \
--output soc_system.dtb \
--type dtb \
--board hps_isw_handoff/soc_system_hps_0/hps.xml \
--board hps_isw_handoff/soc_system_hps_0/emif.xml \
--clocks
# Get zImage
cd ~/de10nano-sample
git clone -b socfpga-5.10.50-lts https://github.com/altera-opensource/linux-socfpga.git
cd linux-socfpga
make socfpga_defconfig
make zImage Image modules -j 48
make modules_install INSTALL_MOD_PATH=modules_install
rm -rf modules_install/lib/modules/*/build
rm -rf modules_install/lib/modules/*/source
# Get RootFs
cd ~/de10nano-sample
mkdir rootfs && cd rootfs
git clone -b kirkstone https://git.yoctoproject.org/poky
git clone -b kirkstone https://git.yoctoproject.org/meta-intel-fpga
source poky/oe-init-build-env ./build
echo 'MACHINE = "cyclone5"' >> conf/local.conf
echo 'BBLAYERS += " ${TOPDIR}/../meta-intel-fpga "' >> conf/bblayers.conf
bitbake core-image-minimal
# Get SD card image
cd ~/de10nano-sample
mkdir sd-card
mkdir -p sd-card/sdfs/extlinux
mkdir -p sd-card/rootfs
cp u-boot-socfpga/u-boot-with-spl.sfp sd-card
cp linux-socfpga/arch/arm/boot/zImage sd-card/sdfs
cp DE10_NANO_SoC_GHRD/soc_system.dtb sd-card/sdfs
sudo tar xf rootfs/build/tmp/deploy/images/cyclone5/core-image-minimal-cyclone5.tar.gz -C sd-card/rootfs
sudo rm -rf sd-card/rootfs/lib/modules/*
sudo cp -r linux-socfpga/modules_install/lib/modules/*/* sd-card/rootfs/lib/modules
cd ~/de10nano-sample/sd-card
chmod +x make_sdimage_p3.py
# Edit make_sdimage_p3.py line 455
# ["-F 32", "-I"] -> ["-F", "32", "-I"]
echo "LABEL Linux Default" > sdfs/extlinux/extlinux.conf
echo " KERNEL ../zImage" >> sdfs/extlinux/extlinux.conf
echo " FDT ../soc_system.dtb" >> sdfs/extlinux/extlinux.conf
echo " APPEND root=/dev/mmcblk0p2 rw rootwait earlyprintk console=ttyS0,115200n8" >> sdfs/extlinux/extlinux.conf
sudo python3 make_sdimage_p3.py -f \
-P u-boot-with-spl.sfp,num=3,format=raw,size=10M,type=A2 \
-P sdfs/*,num=1,format=fat32,size=100M \
-P rootfs/*,num=2,format=ext3,size=300M \
-s 512M \
-n sdcard_cv.img
Thanks & Regards