mflash_drv.c - writing to flash while XIP

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

mflash_drv.c - writing to flash while XIP

841 Views
mmlee
Contributor II

I'm trying to get the mflash_drv.c to work, which seems to be be able to write to the hyperflash while XIP from it.

I found the driver in SDK_2.6.1_EVKB-IMXRT1050\rtos\amazon-freertos\lib\third_party\mcu_vendor\nxp\mflash\mimxrt1052

I'm on the EVKB running from hyperflash.

I've put all the mflash_drv.c functions into ITCM (verified by looking at the PC), as well as all the fsl_flexspi.c functions.

I'm calling mflash_drv_init(); first and then mflash_drv_write_page();. 

The mflash_drv_write_page() always results in a reset after calling CLOCK_DisableClock(kCLOCK_FlexSpi); in mflash_drv_write_page_internal().

I don't really understand why.

Any idea what I'm doing wrong? Is it possible that my clocks or pins are wrong? How is this driver supposed to be used?

0 Kudos
1 Reply

737 Views
jeremyzhou
NXP Employee
NXP Employee

Hi mmlee,

Thank you for your interest in NXP Semiconductor products and
for the opportunity to serve you.
According to your statement, i.MX RT1050 boot from Hyperflash, it means the code should forbid to reconfigure FlexSPI which in charge of the connecting the Hyperflash, unless copying the codes to RAM or SDRAM prior to executing it.
Hope this is clear.

Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos