Writing to NOR Flash

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

Writing to NOR Flash

Jump to solution
1,380 Views
rnicolls
Contributor III

Hi,

I'm using the i.MXRT1176 and am planning to use the FlexSPI module to write a firmware update to the external NOR Flash. The Application will be running from this same external memory, however, the update will be written to a different section. I haven't used an MCU with external program memory before, so it's unclear to me if I can write to it while executing the application. 

Can I simply write to the Flash or would I have to execute the program from RAM while writing?

Thanks.

Tags (1)
0 Kudos
1 Solution
1,341 Views
rnicolls
Contributor III

Hi,

I made a mistake and didn't actually place the linkscripts folder in the same location as the project files. I was able to place the functions into RAM.

View solution in original post

0 Kudos
5 Replies
1,375 Views
jay_heng
NXP Employee
NXP Employee

If your selected flash doesn't support Read-While-Write feature, then you have to execute the program from RAM while writing. otherwise you can simply write to the Flash (code in one block, to write another block).

You can refer to below example, for XIP build, it relocates flexspi operation code in RAM (MIMXRT1176xxxxx_cm7_flexspi_nor.icf), as the default flash in RT1170-EVK doesn't support Read-While-Write

\SDK_2.12.0_MIMXRT1170-EVK\boards\evkmimxrt1170\driver_examples\flexspi\nor\polling_transfer

 

initialize by copy {
  readwrite,
  /* Place in RAM flash and performance dependent functions */
  object flexspi_nor_flash_ops.o,
  object fsl_flexspi.o,
  section .textrw
};

 

i

0 Kudos
1,355 Views
rnicolls
Contributor III

Thank you for the helpful reply.

I've taken the linker script templates from the example you mentioned and modified with files I wish to place into RAM. They're located within a linkscripts folder within the project directory, as mentioned in Section 17.14.2 of the MCUXpresso User Guide. It looks like the functions are still being placed in Flash. Is there another step I've missed?

0 Kudos
1,351 Views
jeremyzhou
NXP Employee
NXP Employee

Hi @rnicolls ,
Thanks for your reply.
To provide the fastest possible support, I'd highly recommend you refer to the polling_transfer demo for MCUXpresso IDE.
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
1,346 Views
rnicolls
Contributor III

Hi,

Where do I go for this demo? Do you mean the flexspi_polling_transfer example provided by the SDK?

Thanks,

Rory

0 Kudos
1,342 Views
rnicolls
Contributor III

Hi,

I made a mistake and didn't actually place the linkscripts folder in the same location as the project files. I was able to place the functions into RAM.

0 Kudos