Error while booting

Hi,

I intended to run some Linux applications on the HiFive Unleashed board. But, I am not being able to boot in any way. I have tried the following ways:

  1. I tried the SiFive OpenEmbedded Layer SDK. I was able to execute all the steps, build the image and copy the image on the SD card successfully. But, after putting the card in the slot and trying to boot up keeping the MSEL 1101, the serial console shows

Error 0x0000000000000005

  1. I tried the image from Fedora Project. The image was built and copied successfully. But, while trying to boot keeping the MSEL 1101, the serial console shows

Error 0x0000000000000003

  1. Finally, I intended to go for Debian Port, but it needs a SiFive image in the primary partition. So, I went for the Freedom Unleashed SDK (Branch: v1_0), according to chapter 7 of the documentation, but the build fails with the following errors:

Unescaped left brace in regex is illegal here in regex; marked by ← HERE in m/${ ← HERE ([^ \t=:+{}]+)}/ at /home/sayeed42/Downloads/freedom-u-sdk/work/buildroot_initramfs/host/usr/bin/automake line 3936.
autoreconf: /home/sayeed42/Downloads/freedom-u-sdk/work/buildroot_initramfs/host/usr/bin/automake failed with exit status: 255
package/pkg-generic.mk:185: recipe for target ‘/home/sayeed42/Downloads/freedom-u-sdk/work/buildroot_initramfs/build/libtirpc-1.0.1/.stamp_configured’ failed
make[1]: *** [/home/sayeed42/Downloads/freedom-u-sdk/work/buildroot_initramfs/build/libtirpc-1.0.1/.stamp_configured] Error 1
make[1]: Leaving directory ‘/home/sayeed42/Downloads/freedom-u-sdk/buildroot’
Makefile:90: recipe for target ‘/home/sayeed42/Downloads/freedom-u-sdk/work/buildroot_initramfs/images/rootfs.tar’ failed
make: *** [/home/sayeed42/Downloads/freedom-u-sdk/work/buildroot_initramfs/images/rootfs.tar] Error 2

Can anyone point to any direction on what I should do or what I am doing wrong?

“Error 0x0000000000000005” means that the board was unable to start basic communications with the micro SD card - in this case, a failure upon issuing CMD0. This can happen if the card isn’t seated correctly. Try reinserting it. It can also happen with cheap, off-brand, or counterfeit SD cards, so you might try a microSD card purchased from a reliable supplier, if it isn’t already.

“Error 0x0000000000000003” indicates that the board was able to communicate with the microSD card, but that it couldn’t find a GPT partition with the right GPT UUID. How did you write the image to the SD card? Which image did you try?

The buildroot FUSDK is unmaintained. We recommend following the instructions here:

We have a new release coming up this week with many improvements, so you might want to wait for that branch to appear, or try the “master” branch of meta-sifive in the meantime.

1 Like

Okay, both SiFive OpenEmbedded Layer SDK and Fedora Project images show “Error 0x0000000000000003” after I reinsert the SD card. So, the problem might be in the way I am writing the card.

  1. For the SiFive OpenEmbedded Layer SDK, I am executing the following command:

zcat demo-coreip-cli-freedom-u540.wic.gz | sudo dd of=/dev/sdc1 bs=512K iflag=fullblock oflag=direct conv=fsync status=progress

as instructed in the README file of the repository.

After writing, the partition table looks like this: (I have used gdisk)

GPT fdisk (gdisk) version 1.0.3
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Command (? for help): p
Disk /dev/sdc1: 249704448 sectors, 119.1 GiB
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): F4C38574-B7D8-433F-8316-2C5A4EB40BB5
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 13926400
Partitions will be aligned on 64-sector boundaries
Total free space is 12191 sectors (6.0 MiB)
Number Start (sector) End (sector) Size Code Name
1 8192 274431 130.0 MiB 0700 boot
2 274432 274495 32.0 KiB FFFF primary
3 274496 290879 8.0 MiB FFFF primary
4 294912 13926399 6.5 GiB 8300 root

  1. For the Fedora Project, I am executing:

sudo virt-builder --source https://dl.fedoraproject.org/pub/alt/risc-v/repo/virt-builder-images/images/index --no-check-signature --arch riscv64 --format raw --hostname fed --output /dev/sdc1 --root-password password:riscv fedora-rawhide-developer-20200108.n.0

as instructed in the link.
Partition table after writing:

GPT fdisk (gdisk) version 1.0.3
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Command (? for help): p
Disk /dev/sdc1: 249704448 sectors, 119.1 GiB
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 54A47910-70D3-4FB5-AF40-DAD63952C97D
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 249704414
Partitions will be aligned on 128-sector boundaries
Total free space is 4733 sectors (2.3 MiB)
Number Start (sector) End (sector) Size Code Name
1 2048 1435647 700.0 MiB 8300 _/boot
2 1435648 1435711 32.0 KiB FFFF _/fsbl
3 1435776 1452159 8.0 MiB FFFF _/opensbi-uboot
4 1452160 249701759 118.4 GiB 8300 _/

Now, as I am trying different images one after another, before writing a new image to the card, I do the followings:

  1. I delete all the partitions one by one using gdisk (by typing d)
  2. I create a new empty GUID partition table (GPT) (by typing o)
  3. Lastly, I write table to disk and exit (by typing w)

Am I doing anything wrong here?
Also, it’s worth mentioning, when I start writing the Fedora Project image the following warning shows up:

virt-builder: warning: output device (/dev/sdc1) is a partition. If you
are writing to a USB key or external drive then you probably need to write
to the whole device, not to a partition. If this warning is wrong then you
can disable it with --no-warn-if-partition

Does this mean something? What should I do?

It’s a disk image, I’m fairly sure it needs to be written to the top level (/dev/sdc in this case) not to a partition like /dev/sdc1.

1 Like

Unescaped left brace in regex is illegal here in regex; marked by ← HERE in m/${ ← HERE ([^ \t=:+{}]+)}/ at /home/sayeed42/Downloads/freedom-u-sdk/work/buildroot_initramfs/host/usr/bin/automake line 3936.

This is a versioning problem. The old buildroot sources won’t build on an OS with a new perl binary that rejects code that old versions used to allow. It is known to work on Ubuntu 16.04 and known to fail on Ubuntu 18.04. There is also a problem with e2fsprogs that you will run into if you get past this problem. You can find workarounds here
Bump dependencies to fix issues with glibc 2.27 and perl 5.26 by michaeljclark · Pull Request #5 · sifive/buildroot · GitHub
However, it is better if you use one of the up to date images, as this old v1_0 stuff is badly out of date and not supported anymore.

1 Like

Thanks to @vmedea, this is exactly what I was doing wrong. Thanks for pointing it out. I am now running my intended applications on the fedora image.

Thanks to @paulw for the explanations of the errors. As my experience in this sector is little, these will help me if these errors come up again in the future.

Also, thanks to @jimw for the suggestion, I will try it.