- 
                Notifications
    
You must be signed in to change notification settings  - Fork 8.2k
 
Add MIMXRT685 FlexSPI XIP support. #34502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add MIMXRT685 FlexSPI XIP support. #34502
Conversation
          Unit Test Results     10 files    41 suites   12m 29s ⏱️ For more details on these failures, see this check. Results for commit df354337.  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this LUT be used for other octal flashes or is it specific to MX25UM51345G?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is specific to MX25UM51345G. JEDEC standard is not valid for octal mode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not just memory specific but to do XIP or to trigger a read command sequence from LUT, dummy cycles are required. And dummy cycles required varies as per frequency at which flash is operated (memory model's data sheet). So along with memory model LUT is also platform/board specific.
| 
           Can you take a look at PR #34789 and add a partition section to the dts  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit can be squashed with the earlier one that changes board dts file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After adding storage_partition to dts still facing an issue to get littlefs running. If able to get it to work will squash commits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sample is failing because flash_area is trying to use the flexspi device with the flash API, when it should use the mx25um51345g device instead. You can fix this by moving the partitions section inside the mx25um51345g node.
Area 0 at 0x3f00000 on MX25UM51345G for 1048576 bytes
/lfs mount: 0
/lfs: bsize = 16 ; frsize = 4096 ; blocks = 256 ; bfree = 254
/lfs/boot_count stat: 0
        fn 'boot_count' siz 4
/lfs/boot_count read count 1: 4
/lfs/boot_count seek start: 0
/lfs/boot_count write new boot count 2: 4
/lfs/boot_count close: 0
/lfs opendir: 0
  F 4 boot_count
End of files
/lfs unmount: 0
[00:16:13.131,023] <inf> littlefs: LittleFS version 2.2, disk version 2.0
[00:16:13.133,602] <inf> littlefs: FS at MX25UM51345G:0x3f00000 is 256 0x1000-byte blocks with 512 e
[00:16:13.133,605] <inf> littlefs: sizes: rd 16 ; pr 16 ; ca 64 ; la 32
[00:16:13.133,876] <inf> littlefs: /lfs mounted
[00:16:13.161,600] <inf> littlefs: /lfs unmounted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Done.
| 
           I noticed some documentation and code compliance violation in CI workflows. Latest force-push and rebased with master addresses only those.  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Warnings are treated as errors in CI. This needs to be changed to mx25um51345g@2
mimxrt685_evk_cm33.dts.pre.tmp:370.31-387.4: Warning (spi_bus_reg): /soc/peripheral@50000000/spi@134000/mx25um51345g@0: SPI bus unit address format error, expected "2"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
| 
           Seeing a build failure on   | 
    
Enable FlexSPI NOR flash driver with XIP build options. Configure FlexSPI pins, update board documentation. Add FlexSPI NOR flash dts node for mimxrt685_evk. Enable flash storage by adding partition to dts file. Using last 1MB for storage, and reserving 63MB for code. Signed-off-by: Saurabh Jagdhane <[email protected]>
Move LUT to driver. Update CMake to include SoC specific driver. Fix mimxrt685_evk LUT header spacing. Signed-off-by: Saurabh Jagdhane <[email protected]>
Enable XIP based on SoC specific option. Signed-off-by: Saurabh Jagdhane <[email protected]>
Add mimxrt685_evk_cm33 board to the platform_allow list for the littlefs sample application. Signed-off-by: Saurabh Jagdhane <[email protected]>
Driver APIs are tested using sample applications:
These changes have dependency on PR #34086. So that MPU is setup to allow execution of driver code relocated to SRAM.