Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Commit

Permalink
Initialize SD card before passing it
Browse files Browse the repository at this point in the history
Signed-off-by: Petr Horacek <[email protected]>
  • Loading branch information
phoracek committed Sep 27, 2023
1 parent cb9df07 commit 2956f36
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion eurorack/src/system/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,21 @@ impl System {
.internal_pull_up(true)
.speed(Speed::VeryHigh);

let sdmmc: SDMMC = dp.SDMMC1.sdmmc(
let mut sdmmc: SDMMC = dp.SDMMC1.sdmmc(
(clk, cmd, d0, d1, d2, d3),
ccdr.peripheral.SDMMC1,
&ccdr.clocks,
);

let bus_frequency = 50.MHz();

for _ in 0..10 {
if sdmmc.init(bus_frequency).is_ok() {
break;
}
cortex_m::asm::delay(480_000_000);
}

sdmmc
};

Expand Down

0 comments on commit 2956f36

Please sign in to comment.