Re: RPI5 16GB panic on boot

From: Mark Millard <marklmi_at_yahoo.com>
Date: Mon, 03 Feb 2025 19:05:19 UTC
On Feb 3, 2025, at 09:16, Mark Millard <marklmi@yahoo.com> wrote:

> On Feb 2, 2025, at 01:56, Ronald Klop <ronald-lists@klop.ws> wrote:
> 
>> All my goodies are in and connected so I could capture the logs via serial easily.
>> 
>> The RPI5 16GB starts booting the kernel and then panics very early in the process.
>> 
>> The full serial output can be found here: https://wiki.freebsd.org/RonaldKlop/Raspberry%20Pi%205%2016GB.
>> 
>> The TL;DR is: Hit [Enter] to boot immediately, or any other key for command prompt.
>> Booting [/boot/kernel/kernel]... 
>> Loading splash ok
>> No valid device tree blob found!
>> WARNING! Trying to fire up the kernel, but no device tree blob found!
>> EFI framebuffer information:
>> addr, size 0x3f600000, 0x5eec00
>> dimensions 1440 x 1080
>> stride 1440
>> masks 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000
>> x0: 0xffff000000fcae40
>> x1: 0x0000000000000001
>> x2: 0x0000000000000019
>> x3: 0x0000000000000064
>> x4: 0x0000000000000076
>> x5: 0x0000000000000000
>> x6: 0x1700000000000000
>> x7: 0x0000000000000017
>> x8: 0xffff000000defb20
>> x9: 0xffff000001044000
>> x10: 0xffff00000103f000
>> x11: 0x0101010101010101
>> x12: 0x000000000000003b
>> x13: 0x0000000000000001
>> x14: 0x1700000000000000
>> x15: 0x0000000000000010
>> x16: 0x00000000000000b4
>> x17: 0x0000000000000000
>> x18: 0xffff000000def880
>> x19: 0xffff000000fcae40
>> x20: 0xffff000000dec000
>> x21: 0xffff00000114b800
>> x22: 0x0000000000000000
>> x23: 0x0000000038070018
>> x24: 0xffff000001152000
>> x25: 0xffffa00000000000
>> x26: 0xffffa0003b5d0018
>> x27: 0x000000003095b000
>> x28: 0xffff00000114b000
>> x29: 0xffff000000defaa0
>> sp: 0xffff000000def880
>> lr: 0xffff0000008687a8
>> elr: 0xffff0000008687bc
>> spsr: 0x00000000804002c9
>> far: 0xe1f35e376ecbf7f7
>> esr: 0x00000000be000011
>> panic: Unhandled System Error
>> cpuid = 0
>> time = 1
>> KDB: stack backtrace:
>> #0 0xffff000000505fc0 at ??+0
>> #1 0xffff0000004b6cec at ??+0
>> #2 0xffff0000004b6b48 at ??+0
>> #3 0xffff000000885d00 at ??+0
>> #4 0xffff00000085b158 at ??+0
>> Uptime: 1s
>> Rebooting...
>> cpu_reset failed
>> Any thoughts about what I could try to fix this?
>> 
> 
> Historically I adjust the EEPROM (or other
> such) configuration to have BOOT_UART=1 set in
> order to get the most very early stage debug
> output, at least if it is not the default as
> they supply that.
> 
> I also use config.txt with enabling of more RPi*
> firmware-stage debug output than has been
> historically been the default. See later below.
> 
> All this material applies for both booting
> UEFI/ACPI via EDK2 and booting via u-boot: it is
> for stages before those materials are involved.
> 
> (Note: my mounting of the micrsd card's msdosfs
> is odd and results in the /RPi5-edk2/ being
> the mount point. In my context /boot/efi/ is
> the msdosfs on the USB3 media that has the FreeBSD
> UFS file system used to boot and operate. The same
> USB3 media boots other systems too that do use that
> USB3 based msdosfs instead.)
> 
> # more /RPi5-edk2/config.txt
> armstub=RPI_EFI.fd
> device_tree_address=0x1f0000
> device_tree_end=0x210000
> 
> # Force 32 bpp framebuffer allocation.
> framebuffer_depth=32
> 
> # Disable compensation for displays with overscan.
> disable_overscan=1
> 
> # Force maximum USB power regardless of the power supply.
> usb_max_current_enable=1
> 
> # Force maximum CPU speed.
> force_turbo=1
> 
> #
> # Local additions:
> enable_uart=1
> uart_2ndstage=1
> dtdebug=1
> disable_commandline_tags=1
> #
> [pi5]
> over_voltage_delta=100000
> arm_freq=2600
> [all]
> 
> 
> (I do not try to have a video console going.)
> 
> 
> Dealing with only that stage, this results in the
> output (but it looks like there is a newer EEPROM
> content update v2025.01.22-2712 that I need to
> apply, so this might change some after I do that):
> 

I'm replacing the text with what the modern EEPROM
content produced. I'll note that your EEPROM vintage:

RPi: BOOTSYS release VERSION:26826259 DATE: 2024/09/23 TIME: 14:02:56

is older then either of my reports show. Mine have BOOT_UART=1
as part of the configuration.

  0.38 RPi: BOOTSYS release VERSION:a7753063 DATE: 2025/01/22 TIME: 00:16:51
  0.42 BOOTMODE: 0x06 partition 0 build-ts BUILD_TIMESTAMP=1737505011 serial 8a9af836 boardrev d04170 stc 842243
  0.52 AON_RESET: 00000003 PM_RSTS 00001020
  0.56 POWER_OFF_ON_HALT: 0 WAIT_FOR_POWER_BUTTON 0 power-on-reset 0
  0.65 RP1_BOOT chip ID: 0x20001927
  0.70 PCIEx1: PWR 0 DET_WAKE 0
  0.70 part 00000000 reset_info 00000000
  0.74 PMIC reset-event 00000000 rtc 67a090c2 alarm 00000000 enabled 0
  0.80 uSD voltage 3.3V
  0.99 Initialising SDRAM rank 2 total-size: 64 Gbit 4267 (0x14 0x00)
  1.02 DDR 4267 1 0 64 152 BL:1
  2.28 OTP boardrev d04170 bootrom a a
  2.29 Customer key hash 0000000000000000000000000000000000000000000000000000000000000000
  2.37 VC-JTAG unlocked
  2.59 RP1_BOOT chip ID: 0x20001927

  3.93 RP1_BOOT chip ID: 0x20001927
  3.93 RP1_BOOT: fw size 46888
  4.31 PCI2 init
  4.31 PCI2 reset
  4.76 PCIe scan 00001de4:00000001
  4.76 RP1_CHIP_INFO 20001927

  4.79 RPi: BOOTLOADER release VERSION:a7753063 DATE: 2025/01/22 TIME: 00:16:51
  4.86 BOOTMODE: 0x06 partition 0 build-ts BUILD_TIMESTAMP=1737505011 serial 8a9af836 boardrev d04170 stc 4186540
  4.96 PCIEx1: PWR 0 DET_WAKE 0
  4.99 M.2 PCIe HAT not detected.
  4.23 usb_pd_init status 3
  4.23 USB_PD CONFIG 0 43
  4.34 XHCI-STOP
  4.34 xHC0 ver: 272 HCS: 03000440 140000f1 07ff000a HCC: 0240fe6d
  4.45 USBSTS 11
  4.47 xHC0 ver: 272 HCS: 03000440 140000f1 07ff000a HCC: 0240fe6d
  4.52 xHC0 ports 3 slots 64 intrs 4
  4.64 XHCI-STOP
  4.64 xHC1 ver: 272 HCS: 03000440 140000f1 07ff000a HCC: 0240fe6d
  4.69 USBSTS 1
  4.71 xHC1 ver: 272 HCS: 03000440 140000f1 07ff000a HCC: 0240fe6d
  4.76 xHC1 ports 3 slots 64 intrs 4
  4.84 USB-PD: src-cap PDO object1 0x0a0191f4
  4.85 Current 5000 mA
  4.87 Voltage 5000 mV
  4.89 USB-PD: src-cap PDO object2 0x0002d12c
  4.93 Current 3000 mA
  4.95 Voltage 9000 mV
  4.97 USB-PD: src-cap PDO object3 0x0003c0e1
  4.02 Current 2250 mA
  4.04 Voltage 12000 mV
  4.06 USB-PD: src-cap PDO object4 0x0004b0b4
  4.10 Current 1800 mA
  4.12 Voltage 15000 mV
  4.14 Boot mode: SD (01) order f4
  4.62 USB3[3] 002a1203 connected enabled
  4.64 USB3 root HUB port 3 init
  4.69 DEV [01:00] 3.00 000000:03 class 0 VID 0bda PID 8153
  4.32 SD HOST: 200000000 CTL0: 0x00800000 BUS: 400000 Hz actual: 390625 HZ div: 512 (256) status: 0x1fff0000 delay: 276
  4.43 SD HOST: 200000000 CTL0: 0x00800f00 BUS: 400000 Hz actual: 390625 HZ div: 512 (256) status: 0x1fff0000 delay: 276
  4.99 OCR c0ff8000 [232]
CID: 0003534453433132388064b7bd820124
CSD: 400e00325b590003b8ab7f800a404000
  5.09 SD: bus-width: 4 spec: 2 SCR: 0x02458043 0x00000000
  5.16 SD HOST: 200000000 CTL0: 0x00800f04 BUS: 50000000 Hz actual: 50000000 HZ div: 4 (2) status: 0x1fff0000 delay: 2
  5.28 MBR: 0x00000001,249737215 type: 0xee
  5.30 MBR: 0x00000000,       0 type: 0x00
  5.33 MBR: 0x00000000,       0 type: 0x00
  5.37 MBR: 0x00000000,       0 type: 0x00
  5.41 Trying partition: 0
  5.46 GPT 4e194f550bb0ee11be88d063b402e5fb 000000001 00ee2afff num-partitions 128 entry-size 128 pentry 2 first 0
  5.56 GPT partition: 0 c12a7328-f81f-11d2-ba4b-00a0c93ec93b 000000800..00ee2a7ff
  5.61 Matched GUID bootable-part-idx 0 want partition 0
  5.68 type: 32 lba: 2048 'BSD4.4  ' ' NO NAME    ' clusters 3901127 (64)
  5.72 rsc 32 fat-sectors 30478 root dir cluster 2 sectors 0 entries 0
  5.81 FAT32 clusters 3901127
  5.83 [sdcard] autoboot.txt not found
  5.85 Select partition rsts 0 C(boot_partition) 0 EEPROM config 0 result 0
  5.92 Trying partition: 0
  5.97 GPT 4e194f550bb0ee11be88d063b402e5fb 000000001 00ee2afff num-partitions 128 entry-size 128 pentry 2 first 0
  5.07 GPT partition: 0 c12a7328-f81f-11d2-ba4b-00a0c93ec93b 000000800..00ee2a7ff
  5.11 Matched GUID bootable-part-idx 0 want partition 0
  5.19 type: 32 lba: 2048 'BSD4.4  ' ' NO NAME    ' clusters 3901127 (64)
  5.23 rsc 32 fat-sectors 30478 root dir cluster 2 sectors 0 entries 0
  5.32 FAT32 clusters 3901127
  5.35 Read config.txt bytes      474 hnd 0xd4
  5.37 [sdcard] pieeprom.upd not found
  5.40 usb_max_current_enable forced to 1
  5.44 set_reboot_order 0
  5.57 Read bcm2712-rpi-5-b.dtb bytes    76038 hnd 0xcf
  5.59 dt-match: compatible: raspberrypi,5-model-b match: brcm,bcm2712
  5.65 dt-match: compatible: brcm,bcm2712 match: brcm,bcm2712
  5.77 Read /config.txt bytes      474 hnd 0xd4
  5.81 Read /config.txt bytes      474 hnd 0xd4
  5.86 MESS:00:00:05.186242:0: Initial voltage 800000 temp 40577
  5.86 MESS:00:00:05.386827:0: avs_2712: AVS pred 9246 924600 temp 41676
  5.90 MESS:00:00:05.390434:0: vpred 924 mV +0
  5.99 MESS:00:00:05.399192:0: FB framebuffer_swap 1
  5.18 MESS:00:00:05.418922:0: Select resolution HDMI0/2 hotplug 0 max_mode 2
  5.22 MESS:00:00:05.422972:0: Select resolution HDMI1/2 hotplug 0 max_mode 2
  5.30 BMD "kernel_2712.img" not found
  5.33 fs_open: 'kernel_2712.img' 
  5.36 BMD "kernel8.img" not found
  5.39 fs_open: 'kernel8.img' 
  5.51 MESS:00:00:05.451899:0: dtb_file 'bcm2712-rpi-5-b.dtb'
  5.54 MESS:00:00:05.454547:0: dtdebug: Trying Device Tree file 'bcm2712-rpi-5-b.dtb'
  5.62 Loading 'bcm2712-rpi-5-b.dtb' to 0x00000000 offset 0x1f0000
  5.76 Read bcm2712-rpi-5-b.dtb bytes    76038 hnd 0xcf
  5.94 MESS:00:00:05.494560:0: dtdebug: delete_node(/__local_fixups__)
  5.02  /overlays/overlay_map.dtb 
  5.02 MESS:00:00:05.502791:0: dtdebug: using platform 'bcm2712'
  5.08 MESS:00:00:05.508542:0: dtdebug: overlay map not loaded
  5.36 PCIEx1: PWR 0 DET_WAKE 0
  5.56 Read /config.txt bytes      474 hnd 0xd4
  5.35 [sdcard] /cmdline.txt not found
  5.36  /cmdline.txt 
  5.99 MESS:00:00:05.799691:0: dtparam: cam0-pwdn=34
  5.05 MESS:00:00:05.805692:0: dtdebug: /__overrides__ has no cam0-pwdn property
  5.10 MESS:00:00:05.809992:0: Unknown dtparam 'cam0-pwdn' - ignored
  5.16 MESS:00:00:05.816120:0: dtparam: cam1-pwdn=46
  5.24 MESS:00:00:05.824950:0: dtdebug: /__overrides__ has no cam1-pwdn property
  5.29 MESS:00:00:05.829254:0: Unknown dtparam 'cam1-pwdn' - ignored
  5.43 MESS:00:00:05.843879:0: dtparam: cooling_fan=1
  5.49 MESS:00:00:05.849849:0: dtdebug: found override cooling_fan
  5.52 MESS:00:00:05.852947:0: dtdebug:   override cooling_fan: string target 'status'
  5.74 MESS:00:00:05.874025:0: dtdebug:   override cooling_fan: string target 'status'
  5.86 MESS:00:00:05.886744:0: dtdebug: delete_node(/hat)
  5.93 MESS:00:00:05.893505:0: dtdebug: delete_node(/hat_type1)
  5.00 MESS:00:00:05.900776:0: dtdebug: delete_node(/hat_type2)
  5.08 MESS:00:00:05.908047:0: dtdebug: delete_node(/hat_type3)
  5.26 Loading 'RPI_EFI.fd' to 0x00000000 offset 0x0
  6.18 Read RPI_EFI.fd bytes  2031616 hnd 0x91
  6.20 PCI1 reset
  6.31 PCI2 reset
  6.41 USB-OTG disconnect
  6.81 MESS:00:00:06.081262:0: Starting OS 6081 ms
  6.87 MESS:00:00:06.087109:0: 00000040: -> 00000480
  6.88 MESS:00:00:06.088963:0: 00000030: -> 00100080
  6.93 MESS:00:00:06.093676:0: 00000034: -> 00100080
  6.98 MESS:00:00:06.098388:0: 00000038: -> 00100080
  6.03 MESS:00:00:06.103101:0: 0000003c: -> 00100080

Again: bcm2712-rpi-5-b.dtb . . .

> 
> may well not be using the same .dtb file that should be
> used with the newer RPi5 variant that you have. The proper
> .dtb file for your context might have to be added to what
> ever msdosfs is supplying the RPI_EFI.fd file and the like.
> 

I'll also note that the live dtb content is normally somewhat
idfferent than in the file used: the RPi* firmware makes
adjustments after loading the file. (In a U-Boot context,
U-Boot tends to make some adjustments to what it is given
as well, thus FreeBSD's loader sees the overall result.)

If/when U-Boot is far enough along, it could probably be used
to get a textual "print" (serial console capture) of the device
tree that it hands off. Doing similarlay on other variations
of the RPi5 and diff'ing the cpatures could end up being of
interest.

===
Mark Millard
marklmi at yahoo.com