refactor(core): board-driven SDRAM BSP selection
What changed, and why it matters
This is a routine internal code cleanup. It changes how the firmware build system selects a specific SDRAM memory driver, switching from a list of device-model features to a single board-specific feature. There is no user-facing change and no security-relevant behavior is modified.
No security action required. Treat as normal build-system maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit refactors Cargo feature gating for SDRAM BSP selection. Previously, core/embed/sys/Cargo.toml exposed per-model features (model_d001, model_d002, etc.) and the SDRAM build script selected the STM32F429I-DISC1 BSP when model_d001 was enabled. The patch removes those model features and introduces a dedicated sdram_stm32f429i_disc1 feature, updating the build script to use it. The test feature list is updated from model_t3w1 to models/model_t3w1. This is purely a build-configuration refactor with no functional code changes to the SDRAM driver itself.
Changed components
core/embed/sys/Cargo.tomlcore/embed/sys/sdram/build.rsInspect captured patch +3 / −14
diff --git a/core/embed/sys/Cargo.toml b/core/embed/sys/Cargo.toml
index 5da54bdd..ff9fe015 100644
--- a/core/embed/sys/Cargo.toml
+++ b/core/embed/sys/Cargo.toml
@@ -14,18 +14,6 @@ models.workspace = true
[features]
-# --------------------------------------------------------------------------
-# Model features
-# --------------------------------------------------------------------------
-
-model_d001 = ["rtl/model_d001"]
-model_d002 = ["rtl/model_d002"]
-model_t2t1 = ["rtl/model_t2t1"]
-model_t2b1 = ["rtl/model_t2b1"]
-model_t3b1 = ["rtl/model_t3b1"]
-model_t3t1 = ["rtl/model_t3t1"]
-model_t3w1 = ["rtl/model_t3w1"]
-
# --------------------------------------------------------------------------
# MCU features
# --------------------------------------------------------------------------
@@ -62,13 +50,14 @@ dbg_console_swo = ["dbg_console"]
dbg_console_vcp = ["dbg_console"]
dbg_console_system_view = ["dbg_console", "system_view"]
sdram = []
+sdram_stm32f429i_disc1 = []
storage_hw_key = []
system_view = []
production = ["rtl/production"]
test = [
"mcu_stm32u5g",
- "model_t3w1",
+ "models/model_t3w1",
"emulator",
"kernel_mode",
"secure_mode",
diff --git a/core/embed/sys/sdram/build.rs b/core/embed/sys/sdram/build.rs
index eefd5cff..cf694258 100644
--- a/core/embed/sys/sdram/build.rs
+++ b/core/embed/sys/sdram/build.rs
@@ -7,7 +7,7 @@ pub fn def_module(lib: &mut CLibrary) -> Result<()> {
if cfg!(feature = "emulator") {
// No implementation
- } else if cfg!(feature = "model_d001") {
+ } else if cfg!(feature = "sdram_stm32f429i_disc1") {
lib.add_source("sdram/stm32f429i-disc1/sdram_bsp.c");
} else {
bail_unsupported!();
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.