Skip to content

Instantly share code, notes, and snippets.

@pamaury
Created October 16, 2025 08:29
Show Gist options
  • Select an option

  • Save pamaury/902f79c372b8e1420e583dc6d7f4f261 to your computer and use it in GitHub Desktop.

Select an option

Save pamaury/902f79c372b8e1420e583dc6d7f4f261 to your computer and use it in GitHub Desktop.
Trying to debug the SFDP all-FF bug
diff --git i/sw/host/opentitanlib/src/bootstrap/eeprom.rs w/sw/host/opentitanlib/src/bootstrap/eeprom.rs
index 309c3cd3d1..147acf1a27 100644
--- i/sw/host/opentitanlib/src/bootstrap/eeprom.rs
+++ w/sw/host/opentitanlib/src/bootstrap/eeprom.rs
@@ -8,6 +8,7 @@ use crate::app::TransportWrapper;
use crate::bootstrap::{Bootstrap, UpdateProtocol};
use crate::spiflash::SpiFlash;
use crate::transport::{Capability, ProgressIndicator};
+use crate::uart::console::UartConsole;
/// Implements the SPI EEPROM bootstrap protocol.
pub struct Eeprom;
@@ -44,6 +45,9 @@ impl UpdateProtocol for Eeprom {
payload: &[u8],
progress: &dyn ProgressIndicator,
) -> Result<()> {
+ let uart = transport.uart("console")?;
+ UartConsole::wait_for(&*uart, r"ROM:", std::time::Duration::from_secs(1))?;
+ UartConsole::wait_for(&*uart, r"bootstrap:1", std::time::Duration::from_secs(1))?;
let spi = container.spi_params.create(transport, "BOOTSTRAP")?;
let flash = SpiFlash::from_spi(&*spi)?;
flash.chip_erase(&*spi)?;

This documents the effort is root-cuasing the infamous all-FF SFDP error which happens randomly for seemingly no reason on some boards.

What to do:

  • make note on which branch you are
  • apply the diff below and rerun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment