FPGA, SoC, And CPLD Boards And Kits
FPGA Evaluation and Development Kits
6472 Discussions

Linux fails to boot on DE10-Nano board

YasuoF
Débutant
2 046 Visites
Hi,
 
I try to build a Linux file system for my DE10-Nano board,
 
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
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
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
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

 

Étiquettes (1)
0 Compliments
7 Réponses
YasuoF
Débutant
2 026 Visites

As an addendum to the above description,
If I replace the dtb with socfpga_cyclone5_socdk.dtb in ~/de10nano-sample/linux-socfpga/arch/arm/boot/, LINUX will boot.
Based on the above facts, we believe that there is a mistake in the way the dtb was created.

0 Compliments
aikeu
Employé
1 984 Visites

Hi YasuoF,


Can share the full boot up logs error for linux?

Would like to see if any particular failure indication from there.


Terasic DE10 is using Cylone V architecture, can check if there is any difference on the device tree configuration used by Cyclone V:

https://github.com/altera-opensource/linux-socfpga/blob/socfpga-6.1.55-lts/arch/arm/boot/dts/socfpga_cyclone5_socdk.dts


Thanks.

Regards,

Aik Eu


0 Compliments
YasuoF
Débutant
1 971 Visites

Hi, @aikeu 

 

The reason it stopped at that line was due to a bad terminal setting, and the scrolling just stopped in the middle of the line.
I apologize for the inconvenience.

 

However, Linux still does not boot.

It appears that mmcblk0p2 cannot be opened. How can I resolve this issue?

 

I'll upload the correct log as bootup-log.txt.

 

Also, I have compared the dts uploaded to Github with the dts created by the above procedure, but there are too many differences to discern what is causing the problem.

0 Compliments
aikeu
Employé
1 918 Visites

Hi YasuoF,


I not familiar with the error to be specific and it seems that it has something to do with the rootfs does not match with the kernel.

I am thinking if we can compare and check with some pre-built images first from rocketboards release for cyclone 5:

https://releases.rocketboards.org/2022.11/gsrd/c5_gsrd/


Thanks.

Regards,

Aik Eu


0 Compliments
aikeu
Employé
1 843 Visites

Hi YasuoF,


May I know any new follow up on the case?


Thanks.

Regards,

Aik Eu


0 Compliments
YasuoF
Débutant
1 835 Visites

Hi @aikeu 

 
Currently, no progress has been made.
I will report back if any progress is made.
Due to priorities, I can no longer work on this topic for a few months, so you may close this topic.
 
Thanks & Regards
0 Compliments
aikeu
Employé
1 828 Visites

Hi YasuoF,


I will close the thread first. Do consider re-open a new thread if there is new follow up.


Thanks.

Regards,

Aik Eu


0 Compliments
Répondre