Skip to content

i.MX RT 1170 support #26

Open
Open
@mciantyre

Description

@mciantyre

imxrt-ral v0.5 includes support for both cores of the i.MX RT 1176. You can target the Cortex-M7 with the "imxrt1176_cm7" feature, and the Cortex-M4 with the "imxrt1176_cm4" feature. As of now, you're expected to build separate images for each core.

We addressed the limitations described in this description with new code generation solutions. See the linked PRs for more information.

We dropped any notion of resource management in imxrt-ral. Acquiring a peripheral instance is unsafe, since it's not clear how this should work in multi-core systems that deploy separate images for each core.


Here's some notes describing workarounds or unsolved issues I encountered when trying to add 1176 support to v0.4 of imxrt-ral.

Some peripherals have so many clusters and register arrays that imxrtral.py accidentally generates duplicate symbols. There's more info here. I'm working around this by changing how imxrtral.py generates names for clustered registers. Implementing true register cluster and array support in the RAL could be another approach.

The enumerated values for register fields may differ from the 10xx family. These differences are in the SVDs. Sometimes, they're "better" (more descriptive, easier to read) than what the 10xx SVDs provides.

use imxrt_ral as ral;

// 10xx enumerated values take the register field and add
// a suffix representing the raw bit value.
ral::modify_reg!(ral::lpspi, lpspi, CR, RST: RST_1);
ral::modify_reg!(ral::lpspi, lpspi, CR, RST: RST_0, DOZEN: DOZEN_0, DBGEN: DBGEN_1);

// 11xx. Notice how 'DOZEN_0' is replaced by 'ENABLED' in
// this equivalent snippet. Easier to see understand that
// 0 == "enabled"
ral::modify_reg!(ral::lpspi, lpspi, CR, RST: RESET);
ral::modify_reg!(ral::lpspi, lpspi, CR, RST: NOT_RESET, DOZEN: ENABLED, DBGEN: ENABLED);

And sometimes, they're worse.

// 10xx
ral::modify_reg!(ral::pit, pit, MCR, MDIS: MDIS_0);
// 11xx
ral::modify_reg!(ral::pit, pit, MCR, MDIS: t0301); // Wut?

If a HAL driver uses 10xx-flavored enumerated values, it won't simply build once we introduce the 11xx RAL. Raw bit values don't change, so we could say "don't use enumerated values" and give up readability. Otherwise, we might need a common symbol for these enumerated values, and I'm not yet sure what this looks like.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions