imxrt-rs / imxrt-hal

Rust for NXP i.MX RT
Apache License 2.0
122 stars 29 forks source link

Support for FlexSpi #120

Open Sandvoxel opened 1 year ago

Sandvoxel commented 1 year ago

Is there planned support for access to FlexSPI on the imxrt?

Sandvoxel commented 1 year ago

I have some knowledge of the hardware registers for the imxrt FlexSpi registers as I am using them in a library in C++ to access a flash chip that use QSpi. I would be happy to help out with writing the library to access FlexIo but I'm quite new to rust and don't really know to start on direct memory access to set up registers. I saw this issue on the matter but it seems to have gone cold. My current project is a teensy 4.1 custom board that is planed to be used as a flight computer in the future but is in the early stages (Just completed the first dev board). I would like to use rust over C++ but I would need more access to the hardware such as FlexSpi for the onboard flash chip for data logging.

Sandvoxel commented 1 year ago

I see that is this may have been done with the imxrt-ral library. I would still like to hear input on the matter.

With the course of working on this project I will be writing a SDCard library that should be compatible with the teensy 4.1 sdcard slot I would be happy to make it open source. I did see the post on the teensy-rs repo about adding SD card support.

mciantyre commented 1 year ago

I'm personally not planning FlexSPI support right now. I'm happy to support you or anyone who wants to tackle it.

This could eventually use imxrt-iomuxc support, but I think we could prototype without this feature. Add a marker trait for FlexSPI-compatible pins, and implement it for the Teensy 4.1 pins that you need. A few contributors have gone through the process of adding new traits and pins, so check out the merged PRs to see the process.

I see that is this may have been done with the imxrt-ral library.

Yup, I recommend using imxrt-ral to access the FlexSPI registers.

I will be writing a SDCard library [...]

Awesome. See #119, which we can use to track any HAL developments.

mciantyre commented 1 year ago

We've talked in other issues, and I want to double-check my understanding of this issue.

We're discussing a driver for the FlexIO peripheral (chapter 50 in the 1060 reference manual). We're not discussing the FlexSPI controller (chapter 27 in the 1060 reference manual). The goal is to produce a FlexIO driver capable of QuadSPI. Is that the gist?

Sandvoxel commented 1 year ago

That was a mistake on my part i meant FlexSpi in chapter 27. I have updated my wording on the matter.

mciantyre commented 1 year ago

See also mciantyre/teensy4-rs#100, which asks about EEPROM emulation using FlexSPI.