Skip to content

Commit

Permalink
Add imxrt1040 support
Browse files Browse the repository at this point in the history
An FCB generated from this package could launch a program on a
MIMXRT1040EVK.
  • Loading branch information
mciantyre committed Jan 13, 2025
1 parent 9969b90 commit 59b20ee
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
build:
strategy:
matrix:
feature: ["imxrt1010", "imxrt1020", "imxrt1050", "imxrt1060", "imxrt1064", "imxrt1170", "imxrt1180"]
feature: ["imxrt1010", "imxrt1020", "imxrt1040", "imxrt1050", "imxrt1060", "imxrt1064", "imxrt1170", "imxrt1180"]

runs-on: ubuntu-latest

Expand All @@ -20,7 +20,7 @@ jobs:
clippy:
strategy:
matrix:
feature: ["imxrt1010", "imxrt1020", "imxrt1050", "imxrt1060", "imxrt1170", "imxrt1180"]
feature: ["imxrt1010", "imxrt1020", "imxrt1040", "imxrt1050", "imxrt1060", "imxrt1170", "imxrt1180"]

runs-on: ubuntu-latest

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ packages maintained within this repository.

## [Unreleased]

Add support for new MCUS:

- 1040

## [0.3.3] - 2024-10-26

Add support for the 1180 family
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ keywords = [
[features]
imxrt1010 = []
imxrt1020 = []
imxrt1040 = []
imxrt1050 = []
imxrt1060 = []
imxrt1064 = []
Expand Down
1 change: 1 addition & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use std::env;
static SUPPORTED_FEATURES: &[&str] = &[
"imxrt1010",
"imxrt1020",
"imxrt1040",
"imxrt1050",
"imxrt1060",
"imxrt1064",
Expand Down
1 change: 1 addition & 0 deletions src/flexspi/fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ pub enum SerialClockFrequency {
MHz100,
#[cfg(any(
feature = "imxrt1010",
feature = "imxrt1040",
feature = "imxrt1060",
feature = "imxrt1064",
feature = "imxrt1170",
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
//!
//! - `"imxrt1010"`
//! - `"imxrt1020"`
//! - `"imxrt1040"`
//! - `"imxrt1060"`
//! - `"imxrt1064"`
//! - `"imxrt1170"`
Expand Down
8 changes: 7 additions & 1 deletion src/serial_flash/nor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,20 @@ pub enum SerialClockFrequency {
MHz80,
MHz100,
#[cfg(any(
feature = "imxrt1040",
feature = "imxrt1060",
feature = "imxrt1064",
feature = "imxrt1170",
feature = "imxrt1180"
))]
MHz120,
MHz133,
#[cfg(any(feature = "imxrt1050", feature = "imxrt1060", feature = "imxrt1064"))]
#[cfg(any(
feature = "imxrt1040",
feature = "imxrt1050",
feature = "imxrt1060",
feature = "imxrt1064"
))]
MHz166,
}

Expand Down
35 changes: 35 additions & 0 deletions tests/imxrt1040.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//! Tests specific to 1040 family.
#![cfg(feature = "imxrt1040")]

#[test]
fn serial_clock_frequency() {
use imxrt_boot_gen::flexspi::SerialClockFrequency;

assert_eq!(SerialClockFrequency::MHz30 as u32, 1);
assert_eq!(SerialClockFrequency::MHz50 as u32, 2);
assert_eq!(SerialClockFrequency::MHz60 as u32, 3);
assert_eq!(SerialClockFrequency::MHz75 as u32, 4);
assert_eq!(SerialClockFrequency::MHz80 as u32, 5);
assert_eq!(SerialClockFrequency::MHz100 as u32, 6);
assert_eq!(SerialClockFrequency::MHz120 as u32, 7);
assert_eq!(SerialClockFrequency::MHz133 as u32, 8);
assert_eq!(SerialClockFrequency::MHz166 as u32, 9);
}

#[test]
fn ip_serial_clock_frequency() {
use imxrt_boot_gen::serial_flash::nor::SerialClockFrequency;

assert_eq!(SerialClockFrequency::NoChange as u32, 0);

assert_eq!(SerialClockFrequency::MHz30 as u32, 1);
assert_eq!(SerialClockFrequency::MHz50 as u32, 2);
assert_eq!(SerialClockFrequency::MHz60 as u32, 3);
assert_eq!(SerialClockFrequency::MHz75 as u32, 4);
assert_eq!(SerialClockFrequency::MHz80 as u32, 5);
assert_eq!(SerialClockFrequency::MHz100 as u32, 6);
assert_eq!(SerialClockFrequency::MHz120 as u32, 7);
assert_eq!(SerialClockFrequency::MHz133 as u32, 8);
assert_eq!(SerialClockFrequency::MHz166 as u32, 9);
}

0 comments on commit 59b20ee

Please sign in to comment.