Cannot read and write flash when programing to flash using MIMXRT1170_UFL_L2

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Cannot read and write flash when programing to flash using MIMXRT1170_UFL_L2

跳至解决方案
2,507 次查看
yalin
Contributor II

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.

0 项奖励
回复
1 解答
2,424 次查看
jingpan
NXP TechSupport
NXP TechSupport

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

在原帖中查看解决方案

6 回复数
2,478 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi @yalin ,

If the code is XIP, the cpu can't get next instruction when the flash is reset.

 

Regards,

Jing

0 项奖励
回复
2,466 次查看
yalin
Contributor II

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.

0 项奖励
回复
2,445 次查看
jingpan
NXP TechSupport
NXP TechSupport

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

0 项奖励
回复
2,440 次查看
yalin
Contributor II

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.

0 项奖励
回复
2,425 次查看
jingpan
NXP TechSupport
NXP TechSupport

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

2,419 次查看
yalin
Contributor II

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)".

Link application to RAMLink application to RAM

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.

0 项奖励
回复