Cannot flash secure bootloader on a new RPi4 dual-rank (not CM4)

Open
#389 23 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
raspberry-pi, shell, ubuntu

Research direction

Start by comparing usbboot commits 87d6e03272b0ae155d85a125bfdec03e3d4a1095 and 86a39220a870e463533b7b12294768df08c7582d, using the configuration and UART logs in the report. Reproduce the secure-bootloader recovery flow on a dual-rank RPi4 and trace the SDRAM initialization failure. Done means the current image flashes successfully and the board can still enter mass-storage device mode.

Written by the indexing model from the issue text.

Description

Describe the bug

I have a very strange issue with the latest bootloader and the new RPi4 boards:

  • use plain usbboot on Ubuntu 24.04 built from sources
  • commit-id: "87d6e03272b0ae155d85a125bfdec03e3d4a1095"
  • sign the bootloader
  • create rpi-boot-eeprom-recovery-2026-05-17-2711-vl805-000138c0-sd.img
  • flash it to sdcard
  2.60 RPi: BOOTSYS release VERSION:d179f03a DATE: 2025/09/08 TIME: 15:51:29
  2.60 BOOTMODE: 0x07 partition 0 build-ts BUILD_TIMESTAMP=1757343089 serial ddd14e9d boardrev b03115 stc 2609877
  2.61 PM_RSTS 00001000
  2.62 POWER_OFF_ON_HALT: 0 WAIT_FOR_POWER_BUTTON 0 power-on-reset 1
  2.62 part 00000000 reset_info 00000000
  2.63 uSD voltage 3.3V
  2.63 USB-OTG disconnect
  5.01 SDRAM_CONFIG: 16
  5.01 Initialising SDRAM rank 2 total-size: 16 Gbit 3200 (0x16 0x16)
  5.22 MCB 3200 size-gbit 16 dual-rank 1 not found
  5.02 USB-OTG disconnect
  5.29 BOOT ERROR: code 8 - 'SDRAM failure'

Then I did the same, but with older version:

  • commit-id: "86a39220a870e463533b7b12294768df08c7582d"
  2.56 RPi: BOOTSYS release VERSION:fedc72ea DATE: 2026/06/02 TIME: 16:04:56
  2.57 MFG_VER: 1
  2.57 BOOTMODE: 0x07 partition 0 build-ts BUILD_TIMESTAMP=1780412696 serial ddd14e9d boardrev b03115 stc 2574548
  2.58 PM_RSTS 00001000
  2.58 POWER_OFF_ON_HALT: 0 WAIT_FOR_POWER_BUTTON 0 power-on-reset 1
  2.59 EEPROM ID 0xef3013
  2.59 SFDP None
  2.59 part 00000000 reset_info 00000000
  2.60 uSD voltage 3.3V
  2.60 USB-OTG disconnect
  5.22 SDRAM_CONFIG: 16 board-rev 00000005
  5.22 vc_driver_sdram_init_2711
  5.23 Initialising SDRAM rank 2 total-size: 16Gbit part: 0 (0x16 0x16) odt: 1
  5.23 memsys_init: 0 16Gbit MCB 0x80015ff0: 11696
  5.24 DDR 3200 Mbps dual-rank:1 byte-mode:0 size-gbit:16 part-config:0 odt:1
  6.70 SD_SB 11013110
  6.88 OTP boardrev b03115 bootrom 48b0 48b0

Configuration used in both cases:

#uart_2ndstage=1
#eeprom_write_protect=1
program_pubkey=1
program_rpiboot_gpio=6
program_jtag_lock=1
#recovery_reboot=1
recovery_metadata=0

After i used the older version I was not able to take the board into mass-storage
device mode, but was able to do so with the latest usbboot.

Unfortunatelly I do not have any blank RPi4 to provide more information,
but hope you can advise what needs to be done for the latest usbboot images
to work in particular with dual-rank RAM variant.

Thank you in advance

Steps to reproduce the behaviour

see above

Device(s)

Other

Compute Module IO board.

No response

RPIBOOT logs

No response

Kernel logs

No response

Device UART logs
  • commit-id: "87d6e03272b0ae155d85a125bfdec03e3d4a1095"

    2.60 RPi: BOOTSYS release VERSION:d179f03a DATE: 2025/09/08 TIME: 15:51:29
    2.60 BOOTMODE: 0x07 partition 0 build-ts BUILD_TIMESTAMP=1757343089 serial ddd14e9d boardrev b03115 stc 2609877
    2.61 PM_RSTS 00001000
    2.62 POWER_OFF_ON_HALT: 0 WAIT_FOR_POWER_BUTTON 0 power-on-reset 1
    2.62 part 00000000 reset_info 00000000
    2.63 uSD voltage 3.3V
    2.63 USB-OTG disconnect
    5.01 SDRAM_CONFIG: 16
    5.01 Initialising SDRAM rank 2 total-size: 16 Gbit 3200 (0x16 0x16)
    5.22 MCB 3200 size-gbit 16 dual-rank 1 not found
    5.02 USB-OTG disconnect
    5.29 BOOT ERROR: code 8 - 'SDRAM failure'

  • commit-id: "86a39220a870e463533b7b12294768df08c7582d"

    2.56 RPi: BOOTSYS release VERSION:fedc72ea DATE: 2026/06/02 TIME: 16:04:56
    2.57 MFG_VER: 1
    2.57 BOOTMODE: 0x07 partition 0 build-ts BUILD_TIMESTAMP=1780412696 serial ddd14e9d boardrev b03115 stc 2574548
    2.58 PM_RSTS 00001000
    2.58 POWER_OFF_ON_HALT: 0 WAIT_FOR_POWER_BUTTON 0 power-on-reset 1
    2.59 EEPROM ID 0xef3013
    2.59 SFDP None
    2.59 part 00000000 reset_info 00000000
    2.60 uSD voltage 3.3V
    2.60 USB-OTG disconnect
    5.22 SDRAM_CONFIG: 16 board-rev 00000005
    5.22 vc_driver_sdram_init_2711
    5.23 Initialising SDRAM rank 2 total-size: 16Gbit part: 0 (0x16 0x16) odt: 1
    5.23 memsys_init: 0 16Gbit MCB 0x80015ff0: 11696
    5.24 DDR 3200 Mbps dual-rank:1 byte-mode:0 size-gbit:16 part-config:0 odt:1
    6.70 SD_SB 11013110
    6.88 OTP boardrev b03115 bootrom 48b0 48b0

Dominant language
Shell
Stars
1.3k
Forks
313
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/usbboot

All issues in raspberrypi/usbboot

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.