Skip to content

Commit 9c5b247

Browse files
committed
Add vmu rt1170 fcb
The FCB for this board is a bit unique in that it starts with a relatively slow clock over standard SPI. The board is then expected to reconfigure FlexSPI after boot with a faster clock, quad spi, and a complete LUT of sequences based on how its done in Zephyr.
1 parent 30e80fb commit 9c5b247

File tree

3 files changed

+66
-1
lines changed

3 files changed

+66
-1
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
fcbs:
4242
strategy:
4343
matrix:
44-
fcb: ["imxrt1010evk-fcb", "imxrt1060evk-fcb", "imxrt1170evk-fcb", "imxrt1180evk-fcb"]
44+
fcb: ["imxrt1010evk-fcb", "imxrt1060evk-fcb", "imxrt1170evk-fcb", "imxrt1180evk-fcb", "vmu-rt1170-fcb"]
4545
runs-on: ubuntu-latest
4646
steps:
4747
- uses: actions/checkout@v4

fcbs/vmu-rt1170/Cargo.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[package]
2+
name = "vmu-rt1170-fcb"
3+
version = "0.1.0"
4+
authors.workspace = true
5+
edition.workspace = true
6+
license.workspace = true
7+
repository.workspace = true
8+
categories.workspace = true
9+
keywords.workspace = true
10+
description = "FlexSPI configuration block for NXP's VMU RT1170 Drone Control Board"
11+
12+
[dependencies.imxrt-boot-gen]
13+
version = "0.3"
14+
path = "../.."
15+
features = ["imxrt1170"]
16+
17+
[lib]
18+
path = "lib.rs"

fcbs/vmu-rt1170/lib.rs

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
//! FlexSPI configuration block (FCB) for the iMXRT1170EVK.
2+
//!
3+
//! This FCB is compatible with thei Macronix MX25UM51345GXDI00 Hyperflash (Octal SPI) storage found on the
4+
//! VMU RT1170. However, it only supports reads.
5+
#![no_std]
6+
7+
pub use nor::ConfigurationBlock;
8+
9+
use imxrt_boot_gen::flexspi::{self, opcodes::sdr::*, *};
10+
use imxrt_boot_gen::serial_flash::*;
11+
12+
const BOOT_SEQ_READ: Sequence = SequenceBuilder::new()
13+
.instr(Instr::new(CMD, Pads::One, 0x03))
14+
.instr(Instr::new(RADDR, Pads::One, 0x18))
15+
.instr(Instr::new(READ, Pads::One, 0x04))
16+
.instr(STOP)
17+
.build();
18+
19+
const BOOT_LUT: LookupTable = LookupTable::new().command(Command::Read, BOOT_SEQ_READ);
20+
21+
const BOOT_CONFIGURATION_BLOCK: flexspi::ConfigurationBlock =
22+
flexspi::ConfigurationBlock::new(BOOT_LUT)
23+
.version(Version::new(1, 4, 0))
24+
.read_sample_clk_src(ReadSampleClockSource::InternalLoopback)
25+
.cs_hold_time(1)
26+
.cs_setup_time(1)
27+
.controller_misc_options(0x10)
28+
.serial_flash_pad_type(FlashPadType::Single)
29+
.serial_clk_freq(SerialClockFrequency::MHz80)
30+
.flash_size(SerialFlashRegion::A1, 64 * 1024 * 1024);
31+
32+
/// Boot FlexSPI NOR Configuration for the VMU only needs read commands
33+
/// over single wire SPI at a slower clock.
34+
///
35+
/// After booting the VMU can reconfigure FlexSPI to be clocked faster
36+
/// using OctalSPI as needed with the full LUT of command sequences.
37+
pub const BOOT_SERIAL_NOR_CONFIGURATION_BLOCK: nor::ConfigurationBlock =
38+
nor::ConfigurationBlock::new(BOOT_CONFIGURATION_BLOCK)
39+
.page_size(256)
40+
.sector_size(4 * 1024)
41+
.ip_cmd_serial_clk_freq(nor::SerialClockFrequency::MHz30)
42+
.block_size(64 * 1024);
43+
44+
#[no_mangle]
45+
#[cfg_attr(all(target_arch = "arm", target_os = "none"), link_section = ".fcb")]
46+
pub static FLEXSPI_CONFIGURATION_BLOCK: nor::ConfigurationBlock =
47+
BOOT_SERIAL_NOR_CONFIGURATION_BLOCK;

0 commit comments

Comments
 (0)