This post is highly related with: https://community.nxp.com/t5/i-MX-Processors/RT1021-Writing-to-flash-when-running-XIP-from-the-same-...
RT1021: Writing to flash when running XIP from the same flash.
Hi @jeremyzhou,
I am very interested on this topic.
When you say:
on the condition that relocating the FlexSPI driver in the RAM
How that can be achieved with details? I have taken a look to the example you mention: flexspi_nor_polling_transfer and I see
But I don't see any Flash partitions or anything like that.
My current project is using this other flash driver:
Having the MIMXRT1020-EVK_IS25LP064.cfx is a requirement?
With more details what I want to achieve is to use the 8 MB SPI Flash for different purposes:
Which steps I need to follow?
Many thanks,
Carles
Hi again,
I have imported and tested two examples that seems to interact with the flash as I need:
By default both of them have unchecked the following setting Link application to RAM
If I check this setting, as all the code is placed in RAM both examples run fine, but with the default configuration, that is having the program in Flash as I need for my project, both examples crash:
flash_component_nor:
Debugger starts but then a Fault occurs:
flexspi_nor_polling_transfer:
First execution the program is stucked at some point and it is not recovered, from now on if trying to launch the application again the debugger is not even starting:
To recover the device I need to connect it with 'NXP MCU Boot Utility' and perform a 'Connect to ROM' once.
Any help on how to be able to implement a flash read/write while program is stored in the flash is very appreciated.
Thanks
Hi @Selrac_13 ,
If your spi flash is same a RT1021 EVK, the fexspi demo can work well by default. If it is different, you must change the configuration in evkimxrt1021_flexspi_nor_config.c.
https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/i-MX-RT-FLEXSPI-booting-guide/ta-p/1669262
Regards,
Jing
Hi @Selrac_13 ,
You can refer to the flexspi_polling_transfer example. There is a linkscripts folder in the project. When compile the project, MCUXpresso IDE will read the .ldt file in this folder to generate new link file.
Regards,
Jing
Thanks @jingpan ,
Yes, I have seen the example and I understand the Linker generation, I see the resulting '*.ld' file contains these settings, for example:
My question was about if any other consideration should be also take into account.
For example:
Thanks,
Carles
Hi @Selrac_13 ,
Is it ok to use the Flash driver 'MIMXRT1020_SFDP_QSPI.cfx'? Or I must change it to 'MIMXRT1020-EVK_IS25LP064.cfx'?
Yes, if it can download. Either drivers are fine.
Must I limit the size of the Program Memery Space to 3MB (instead the whole Flash size -> 8MB)
No, set the size according to your flash.
Regards,
Jing