I have a custom board with hyperflash S26KS512 on rt1170, I can program to flash using the super flashing algorithm "MIMXRT1170_UFL_L2" normally. For reading and writing flash, I port the SDK "evkbimxrt1050_flexspi_hyper_flash_polling_transfer" to rt1170, and it can read and write flash normally when programing to ram, but failed when programing to flash, and I check that the program will get stuck when running to "FLEXSPI_SoftwareReset(base)".
Is this problem related to the super flashing algorithm "MIMXRT1170_UFL_L2"? I check the development board which uses the default flashing algorithm with QSPI, and it can read and write flash normally when programing to flash.
Is there anything else to do for reading and writing flash when programing to flash?
Thanks.
Solved! Go to Solution.
Hi @yalin ,
Please check the original demo's .ld file carefully. The flexspi related code located in SRAM. There is a linkscripts folder in the project. It can add something to link file.
Regards,
Jing
Hi @yalin ,
If the code is XIP, the cpu can't get next instruction when the flash is reset.
Regards,
Jing
Hi @jingpan, Thanks for support. So do you mean it is related to the super flashing algorithm "MIMXRT1170_UFL_L2"? Because the development board can read and write flash normally when programing to flash which uses the default flashing algorithm with QSPI "MIMXRT1170_SFDP_QSPI.cfx", which also has FLEXSPI_SoftwareReset(base) in it.
Hi @yalin ,
It's not related to flash download algorithm. Their work is finished after you download your code. In the flexspi demo, the flash driver is located in SRAM. Does your code located in SRAM?
Regards,
Jing
Hi @jingpan
I use the project 'evkmimxrt1170_flexspi_nor_polling_transfer_cm7' by installing SDK 2.11.0 of RT1170, the flash driver is located in BOARD_FLASH by default, not SRAM.
Hi @yalin ,
Please check the original demo's .ld file carefully. The flexspi related code located in SRAM. There is a linkscripts folder in the project. It can add something to link file.
Regards,
Jing
Hi @jingpan
Sorry about making you confused. What I mean is that, when I select the 'Link application to RAM' (when programing to ram), it can read and write the hyper flash normally. But when I don't select 'Link application to RAM' (when programing to flash), the program will get stuck when running to the first "FLEXSPI_SoftwareReset(base)".
And Thanks for your mention of 'linkscripts', I solve the problem by adding 'fsl_clock.o' to SRAM, it can read and write the hyper flash when programing to flash. But the program will get stuck at the second 'FLEXSPI_SoftwareReset(base);' in function 'flexspi_nor_flash_page_program' and lead to a fault, and if I remove it, the program can run normally. I'm not sure the reason why only this 'FLEXSPI_SoftwareReset(base);' will lead to a problem. And I also found that if I run the flexspi_nor_flash_page_program by one step, the program won't get stuck at the second 'FLEXSPI_SoftwareReset(base);' in function 'flexspi_nor_flash_page_program'.
Thanks a lot.