Raspberry Pi 4 Model B 8 GB (2/3 Fail with SD Card error)

This is for ARMv8 based devices

Re: Raspberry Pi 4 Model B 8 GB (2/3 Fail with SD Card error

Postby SpaceOne » Thu Aug 19, 2021 6:33 pm

Hmm, I didn't have to change fstab at all. I left it as it is in the http://os.archlinuxarm.org/os/ArchLinux ... est.tar.gz, meaning I didn't follow instructions on https://archlinuxarm.org/platforms/armv ... berry-pi-4, to change it to mmcblk1 ,

My fstab:
$this->bbcode_second_pass_code('', ' /dev/mmcblk0p1 /boot vfat defaults 0 0')


Perhaps someone can try boot.scr fix also for other rpi4 revisions. If it works also for them, then we can change https://github.com/archlinuxarm/PKGBUIL ... oot.txt.v3 for future rpi aarch64 releases.
SpaceOne
 
Posts: 6
Joined: Mon Aug 02, 2021 10:47 pm

Re: Raspberry Pi 4 Model B 8 GB (2/3 Fail with SD Card error

Postby Stauffenberg » Wed Aug 25, 2021 7:05 pm

In my case the 32bit version worked on my brand new rpi 4 8GB, but I had the same error with the 64bit version.
$this->bbcode_second_pass_code('', '$ cat /sys/firmware/devicetree/base/model;echo
Raspberry Pi 4 Model B Rev 1.4')
to make it work I followed the guide and adjusted these lines in boot/boot.txt from

$this->bbcode_second_pass_code('', '[…]
booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r};
[…]
booti ${kernel_addr_r} - ${fdt_addr_r};
[…]
')

to

$this->bbcode_second_pass_code('', '[…]
booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr};
[…]
booti ${kernel_addr_r} - ${fdt_addr};
[…]
')

installed uboot-tools and ran
$this->bbcode_second_pass_code('', '
# cd boot
# mkimage -A arm -T script -O linux -d boot.txt boot.scr
')

and ignored the sed command before unmounting.

Thanks for the tips here, I strongly suggest to adjust the guide or add a link to this post/thread until this is considered in the image file. It took me quite some time to find this information.
Stauffenberg
 
Posts: 1
Joined: Sat Jan 26, 2019 7:51 am

Re: Raspberry Pi 4 Model B 8 GB (2/3 Fail with SD Card error

Postby StefanT » Fri Oct 29, 2021 8:35 pm

Just came here to report that this is still an issue.

Brand new Raspberry Pi 4 with 4GB
$this->bbcode_second_pass_code('', '
# cat /sys/firmware/devicetree/base/model
Raspberry Pi 4 Model B Rev 1.4
')
Had to do the same modifications that Stauffenberg reported.

I also did not need to change the fstab:
$this->bbcode_second_pass_code('', '
# df -h | grep mmc
/dev/mmcblk0p2 7.2G 2.6G 4.2G 38% /
/dev/mmcblk0p1 197M 109M 89M 56% /boot
')
StefanT
 
Posts: 2
Joined: Fri Oct 29, 2021 7:36 pm

Re: Raspberry Pi 4 Model B 8 GB (2/3 Fail with SD Card error

Postby andreasbaumann » Fri Nov 05, 2021 4:55 pm

I had to change back to mmcblk0 and add the '/' (I only had the /boot mountpoint in fstab, not
the '/' mount point) mount point:

$this->bbcode_second_pass_code('', '/dev/mmcblk0p1 /boot vfat defaults 0 0
/dev/mmcblk0p2 / ext4 defaults 0 0
')

And I definitely needed the booti fdt_addr_r to fdt_addr change mentioned above.

(cat /sys/firmware/devicetree/base/model;echo
Raspberry Pi 4 Model B Rev 1.4)
andreasbaumann
 
Posts: 4
Joined: Wed Mar 11, 2015 7:21 pm

Re: Raspberry Pi 4 Model B 8 GB (2/3 Fail with SD Card error

Postby wadewatts » Tue Nov 30, 2021 1:19 am

hello
tried installing the aarch64 image on my Pi400.
did all of the above following the installation guide for Pi4 and here's my serial dump:

$this->bbcode_second_pass_code('', 'U-Boot 2021.04-1 (May 27 2021 - 18:44:02 +0000) Arch Linux ARM

DRAM: 3.9 GiB
RPI 400 (0xc03130)
MMC: mmcnr@7e300000: 1, emmc2@7e340000: 0
Loading Environment from FAT... *** Warning - bad CRC, using default environment

In: serial
Out: serial
Err: serial
Net: eth0: ethernet@7d580000
PCIe BRCM: link up, 5.0 Gbps x1 (SSC)
starting USB...
Bus xhci_pci: Register 5000420 NbrPorts 5
Starting the controller
USB XHCI 1.00
scanning bus xhci_pci for devices... 3 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
704 bytes read in 17 ms (40 KiB/s)
## Executing script at 02c00000
39852544 bytes read in 3729 ms (10.2 MiB/s)
36631 bytes read in 31 ms (1.1 MiB/s)
7231011 bytes read in 699 ms (9.9 MiB/s)
Moving Image from 0x80000 to 0x200000, end=28e0000
## Flattened Device Tree blob at 2eff3900
Booting using the fdt blob at 0x2eff3900
Using Device Tree in place at 000000002eff3900, end 000000002f002f0b

Starting kernel ...

')

it stops and shuts down after $this->bbcode_second_pass_code('', 'Starting Kernel ...')

Tried two different SD cards. Have had issues with armv7 version as well. Pi OS 32-bit runs fine.
Any leads to workarounds or is changing the bootloader required? (mentioned somewhere else on the forums)
wadewatts
 
Posts: 1
Joined: Tue Nov 30, 2021 1:09 am

Re: Raspberry Pi 4 Model B 8 GB (2/3 Fail with SD Card error

Postby kyoshiro » Mon Jan 03, 2022 1:31 pm

Hi folks,

I came across the SD card error booting a Raspi 4 with aarch64. Error:

$this->bbcode_second_pass_code('', '
mmc1: invalid bus width
mmc1: error -22 whilst initialising SD card
[...]
Waiting 10 seconds for device /dev/disk/by-partuuid/00000000-02 ...
[...shortend output here, lots of above invalid bus width and error -22 msgs ...]
ERROR: device 'PARTUUID=00000000-02' not found. Skipping fsck.
:: mounting ' PARTUUID=00000000-02' on real root
mount: /new_root: can't find PARTUUID=00000000-02.
You are now beeing dropped into an emergency shell.
sh: can´t access tty; job control turned off
[...shortend output here, lots of above invalid bus width and error -22 msgs ...]
')

If I use the arm7l image on exact the same SD card and board, boot succeeds:
$this->bbcode_second_pass_code('', '
[alarm@alarmpi /]$ cat /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 3 (v7l)
BogoMIPS : 108.00
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3

[...shortend output here...]

Hardware : BCM2711
Revision : c03114
Serial : 10000000e3354602
Model : Raspberry Pi 4 Model B Rev 1.4

[alarm@alarmpi /]$ cat /sys/firmware/devicetree/base/model
Raspberry Pi 4 Model B Rev 1.4

[alarm@alarmpi /]$ df -h | grep mmc
/dev/mmcblk0p2 29G 1.3G 27G 5% /
/dev/mmcblk0p1 256M 128M 129M 50% /boot
')

I tried the workaround by modifying the boot.txt and recreating the boot.scr. Then, the above error mmc1: error -22 whilst initialising SD card" has gone but I am still stuck on:
$this->bbcode_second_pass_code('', '
Waiting 10 seconds for device /dev/disk/by-partuuid/00000000-02 ...
[...shortend output here, lots of above invalid bus width and error -22 msgs ...]
ERROR: device 'PARTUUID=00000000-02' not found. Skipping fsck.
:: mounting ' PARTUUID=00000000-02' on real root
mount: /new_root: can't find PARTUUID=00000000-02.
You are now beeing dropped into an emergency shell.
sh: can´t access tty; job control turned off
')

SD card now seems to be initialized as mmc0 device.

UPDATE:

I found the problem on my own:

Mount failure ' PARTUUID=00000000-02' gave me the hint, that I tried some different values here.
Using the PARTUUID when mounting the SD card on another PC didn´t work. But using the device name /dev/mmcblk0p2 brought my p4 to live.

I edited the boot.txt and recreated the boot.scr with following modifications:

$this->bbcode_second_pass_code('', '
# After modifying, run ./mkscr

# Set root partition to the second partition of boot device
part uuid ${devtype} ${devnum}:2 uuid

setenv bootargs earlyprintk console=ttyS1,115200 console=tty0 root=/dev/mmcblk0p2 rw rootwait smsc95xx.macaddr="${usbethaddr}"

if load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /Image; then
if load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /dtbs/${fdtfile}; then
if load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} /initramfs-linux.img; then
booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr};
else
booti ${kernel_addr_r} - ${fdt_addr};
fi;
fi;
fi
')

And also added the root mount point in /etc/fstab for completeness:
$this->bbcode_second_pass_code('', '
/dev/mmcblk0p1 /boot vfat defaults 0 0
/dev/mmcblk0p2 / ext4 defaults 0 0
')

I also tried to boot a raspberry pi4 rev 1.2 with the same SD card and it worked, too.
So if you want a simple multi node setup with different raspberry pi 4 revisions like me, it's quite simple to use one and the same configuration.

Cheers
kyoshiro
kyoshiro
 
Posts: 1
Joined: Mon Jan 03, 2022 1:01 pm

Re: Raspberry Pi 4 Model B 8 GB (2/3 Fail with SD Card error

Postby leuko » Sat Mar 05, 2022 2:45 pm

Dear kyoshiro and wadewatts, your problem could be related to another problem. The symptom in this post seems to be

$this->bbcode_second_pass_code('', '
mmc1: ADMA error: 0x02000000
mmc1: sdhci: =========== SDHCI REGISTER DUMP ============
mmc1: sdhci: Blk size: ...
')

According to https://github.com/NixOS/nixpkgs/issues/135828:

$this->bbcode_second_pass_quote('', '
')This issue affects newer revisions of the Raspberry Pi4, and any boards with the BCM2711C0 rather than previous revisions of the BCM2711.

=> https://forums.raspberrypi.com/viewtopi ... 5#p1910070

The chip revision can be read on the surface of the processor. I do not have any problems with Rpi4s that have the revision 'B0T', but the one with 'C0T' cannot boot. Updating the firmware using `rpi-eeprom` also did not help.

The 'C0T' version has the following output:

$this->bbcode_second_pass_code('', '
$ cat /sys/firmware/devicetree/base/model
Raspberry Pi 4 Model B Rev 1.5
')

As far as I understood, the problem is that the device tree for the Rpi4 must be modified according to the chip revision. The rpi-bootloader firmware handles this automatically, so using the Archlinux armv7 image boots fine.

The above reference has a link to a pull request where the NixOS developers update Uboot to 2021.10 (Alarm uses 2021.04) and apply a patch[1] which modifies the device tree loaded by Uboot according to the firmware.

[1] https://patchwork.ozlabs.org/project/ub ... abora.com/

I do not know if this change is included in the newest Uboot. I fixed the problem modifying /boot/boot.txt according to the post above( viewtopic.php?f=67&t=15422&p=69111#p67299), installing uboot-tools and running `./mkscr` in /boot.

I hope that https://github.com/archlinuxarm/PKGBUIL ... aspberrypi is updated to the latest uboot, which may already include the patch aboive.
leuko
 
Posts: 3
Joined: Sun Jan 16, 2022 8:32 pm

Re: Raspberry Pi 4 Model B 8 GB (2/3 Fail with SD Card error

Postby spble » Sun Mar 06, 2022 2:12 pm

I can confirm that this issue is the result of the C0 stepping on all new Raspberry Pi 4 boards.

The old stepping, B0 works fine:
$this->bbcode_second_pass_code('', '
$ cat /sys/firmware/devicetree/base/model
Raspberry Pi 4 Model B Rev 1.4
')
raspi4b_b0.jpg
BCM2711 code for B0 stepping
raspi4b_b0.jpg (149.35 KiB) Viewed 8649 times


The new stepping, C0, does not work fine:
$this->bbcode_second_pass_code('', '
$ cat /sys/firmware/devicetree/base/model
Raspberry Pi 4 Model B Rev 1.5
')
raspi4b_c0.jpg
BCM2711 code for C0 stepping
raspi4b_c0.jpg (129.26 KiB) Viewed 8649 times


When installing aarch64 according to the install guide, it works fine on any rpi with B0 stepping. However, with C0 stepping I ran into two different errors, depending on if it was a 4GB or 2GB version.
For the 2GB version, I had the following error show up after the kernel init:
$this->bbcode_second_pass_code('', '
[ 3.285920] fe201000.serial: ttyAMA0 at MMIO 0xfe201000 (irq = 24, base_baud = 0) is a PL011 rev2
[ 3.295185] serial serial0: tty port ttyAMA0 registered
[ 3.302518] raspberrypi-firmware soc:firmware: Attached to firmware from 2022-02-04T12:05:40
[ 3.466223] dwc2 fe980000.usb: supply vusb_d not found, using dummy regulator
[ 3.473605] dwc2 fe980000.usb: supply vusb_a not found, using dummy regulator
[ 3.581314] dwc2 fe980000.usb: EPs: 8, dedicated fifos, 4080 entries in SPRAM
[ 3.601366] sdhci-iproc fe300000.mmc: allocated mmc-pwrseq
[ 3.652023] mmc0: SDHCI controller on fe300000.mmc [fe300000.mmc] using PIO
[ 3.704362] ALSA device list:
[ 3.707397] No soundcards found.
[ 3.720024] mmc1: SDHCI controller on fe340000.mmc [fe340000.mmc] using ADMA
[ 3.727761] random: fast init done
[ 3.731546] Freeing unused kernel memory: 6272K
[ 3.736229] Run /init as init process
[ 3.744090] mmc0: new high speed SDIO card at address 0001
[ 3.779752] mmc1: ADMA error: 0x02000000
[ 3.783765] mmc1: sdhci: ============ SDHCI REGISTER DUMP ===========
[ 3.783769] mmc1: sdhci: Sys addr: 0x00000000 | Version: 0x00001002
[ 3.783772] mmc1: sdhci: Blk size: 0x00007008 | Blk cnt: 0x00000001
[ 3.783776] mmc1: sdhci: Argument: 0x00000000 | Trn mode: 0x00000013
[ 3.783778] mmc1: sdhci: Present: 0x1fff0206 | Host ctl: 0x00000011
[ 3.816412] mmc1: sdhci: Power: 0x0000000f | Blk gap: 0x00000080
[ 3.816415] mmc1: sdhci: Wake-up: 0x00000000 | Clock: 0x00007d07
[ 3.829471] mmc1: sdhci: Timeout: 0x00000000 | Int stat: 0x00000000
[ 3.829474] mmc1: sdhci: Int enab: 0x03ff100b | Sig enab: 0x03ff100b
[ 3.829476] mmc1: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000
[ 3.849056] mmc1: sdhci: Caps: 0x45ee6432 | Caps_1: 0x0000a525
[ 3.849059] mmc1: sdhci: Cmd: 0x0000333a | Max curr: 0x00080008
[ 3.862113] mmc1: sdhci: Resp[0]: 0x00000920 | Resp[1]: 0x00edc87f
[ 3.862116] mmc1: sdhci: Resp[2]: 0x325b5900 | Resp[3]: 0x00400e00
[ 3.875171] mmc1: sdhci: Host ctl2: 0x00000008
[ 3.875175] mmc1: sdhci: ADMA Err: 0x00000001 | ADMA Ptr: 0xc3000200
[ 3.875177] mmc1: sdhci: ============================================
[ 3.875179] mmc1: sdhci: c3000200: DMA 0xf3400000, LEN 0x0008, Attr=0x21
[ 3.875183] mmc1: sdhci: c3000208: DMA 0x00000000, LEN 0x0000, Attr=0x03
[ 3.875281] mmc1: error -5 whilst initialising SD card
<< error above repeats constantly >>
')

On a 4GB rpi with C0 stepping, I had a different error:
$this->bbcode_second_pass_code('', '
[ 3.291795] fe201000.serial: ttyAMA0 at MMIO 0xfe201000 (irq = 24, base_baud = 0) is a PL011 rev2
[ 3.301101] serial serial0: tty port ttyAMA0 registered
[ 3.308482] raspberrypi-firmware soc:firmware: Attached to firmware from 2022-02-04T12:05:40
[ 3.472194] dwc2 fe980000.usb: supply vusb_d not found, using dummy regulator
[ 3.479578] dwc2 fe980000.usb: supply vusb_a not found, using dummy regulator
[ 3.587277] dwc2 fe980000.usb: EPs: 8, dedicated fifos, 4080 entries in SPRAM
[ 3.607296] sdhci-iproc fe300000.mmc: allocated mmc-pwrseq
[ 3.657941] mmc0: SDHCI controller on fe300000.mmc [fe300000.mmc] using PIO
[ 3.710320] ALSA device list:
[ 3.713354] No soundcards found.
[ 3.725963] mmc1: SDHCI controller on fe340000.mmc [fe340000.mmc] using ADMA
[ 3.737576] Freeing unused kernel memory: 6272K
[ 3.739192] random: fast init done
[ 3.742261] Run /init as init process
[ 3.759911] mmc0: new high speed SDIO card at address 0001
[ 3.789100] mmc1: invalid bus width
[ 3.792675] mmc1: error -22 whilst initialising SD card
[ 4.114815] mmc1: invalid bus width
[ 4.118382] mmc1: error -22 whilst initialising SD card
<< mmc1 error above repeats continuously >>
')

Following the advice on this thread, I had luck replacing "fdt_addr_r" with "fdt_addr" on only the booti lines, which gives a final boot.txt file of:
$this->bbcode_second_pass_code('', '
# After modifying, run ./mkscr

# Set root partition to the second partition of boot device
part uuid ${devtype} ${devnum}:2 uuid

setenv bootargs console=ttyS1,115200 console=tty0 root=PARTUUID=${uuid} rw rootwait smsc95xx.macaddr="${usbethaddr}"

if load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /Image; then
if load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /dtbs/${fdtfile}; then
if load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} /initramfs-linux.img; then
booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr};
else
booti ${kernel_addr_r} - ${fdt_addr};
fi;
fi;
fi
')
After which, I ran the mkscr script.

I also had to ignore the installation instructions which say:
$this->bbcode_second_pass_code('', '
sed -i 's/mmcblk0/mmcblk1/g' root/etc/fstab
')

I tried many things to reach this outcome, including updating to the latest u-boot, which does not work. I can confirm, however, that using the ARMv7 kernel does work. I confirmed this by booting the fresh aarch64 install on the rpi4b with older B0 stepping, then running `pacman -S linux-rpi` in order to replace the kernel. This also uninstalled u-boot. After plugging this into the newer C0 stepping devices, it worked fine, but I would prefer to run aarch64.

I hope this helps someone! I've spent over two full days trying to figure out this issue.
spble
 
Posts: 1
Joined: Fri Feb 25, 2022 12:28 pm

Re: Raspberry Pi 4 Model B 8 GB (2/3 Fail with SD Card error

Postby graysky » Sun Mar 06, 2022 2:33 pm

To be clear, does a system running linux-rpi (aarch64) exhibit this bug or only one running linux-aarch64?
graysky
Developer
 
Posts: 1727
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000

Re: Raspberry Pi 4 Model B 8 GB (2/3 Fail with SD Card error

Postby kbvw » Fri Mar 11, 2022 8:00 pm

Hello,

$this->bbcode_second_pass_quote('spble', ' ')I hope this helps someone! I've spent over two full days trying to figure out this issue.


On a Raspberry Pi 400 with linux-aarch64, I can confirm that your solution of (a) replacing "fdt_addr_r" with "fdt_addr" on the booti lines in boot.txt and (b) not following the instructions to change the fstab works for me. So your two days have not been spent in vain.

(If I do not change those lines in boot.txt, I don't get the same errors as you mentioned: instead, I get an error that says "invalid bus width" similar to here https://archlinuxarm.org/forum/viewtopic.php?f=65&t=15708.)

However, I still get a few minor issues after booting.

(1) A lot of audit messages are continually spammed to the terminal, which I silenced with audit=0 in boot.txt.

(2) I still get a warning while booting that says: $this->bbcode_second_pass_code('', 'Warning: /lib/modules/5.16.13-1-aarch64-ARCH/modules.devname not found -- ignoring')

After logging in, the file does appear to exist; nothing appears broken so far. Upgrading with pacman and/or rebuilding the kernel image with mkinitcpio works fine, but I get the following warning:

$this->bbcode_second_pass_code('', 'WARNING: No modules were added to the image. This is probably not what you want.')

Apart from the warnings, the system seems to work fine so far.
kbvw
 
Posts: 1
Joined: Fri Mar 11, 2022 7:22 pm

PreviousNext

Return to ARMv8 Devices

Who is online

Users browsing this forum: Baidu [Spider] and 5 guests