External QSPI Page Program Issue

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

External QSPI Page Program Issue

1,951 Views
vasudhevan
Contributor V

Hi,

    I am using imxrt1064evk board.

    We are using flexspi1 interface.

    Whenever we are trying to write page program(256 bytes) nothing is writing into flash while reading it will be zero.

    But if we erase sector then write and read working fine.

    Sector means we have to use 4K data but our most of data it's below 256 bytes.

    Why page program fails without erasing sector ?

    LUT we have to modify ?

Thanks & Regards,

      Vasu

Labels (1)
7 Replies

1,835 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Vasudhevan G ,

  Do you test the RT1064 SDK polling_transfer code?

SDK_2.8.0_EVK-MIMXRT1064\boards\evkmimxrt1064\driver_examples\flexspi\nor\polling_transfer

  If you are using this project to test the QSPI flash write and erase function, do you download it to the RAM?

  Please don't do the XIP, run the code in the RAM, then test it again, can you finish the external QSPI flash write and read?

  To the erase, sector erase is the smallest unit, but write can do the page program, about the detail page and sector size, you can check the related QSPI flash datasheet.

  Now, if you use the official SDK code directly, whether you can do the flash program or not?

Wish it helps you!

If you still have questions about it, please kindly let me know.

Best Regards,

Kerry

 

-------------------------------------------------------------------------------
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,835 Views
vasudhevan
Contributor V

Hi kerryzhou‌,

     Thanks for your response.

     Now we are using SDK_2.7.0_EVK-MIMXRT1064 later we have to port SDK_2.8.0_EVK-MIMXRT1064.

     Read and Write operation we are using external qspi flash not internal flash.

     Before writing page program sector erased means working for me.

     Without sector erase writing 256 bytes data it's not writing.

     FLEXSPI interface compulsory we have to erase sector before page program ?

     We want to store data like,

                  // Write 256 bytes data to zero

                  // Write 256 bytes actual data.

                  // Read data 

    This operation we have to do without erasing sector

Thanks & Regards,

      Vasu 

      

0 Kudos

1,835 Views
mitterha
Senior Contributor I

Hello Vasu,

typically if you delete a flash you will read back 0xFF. If you are not using any special flash (maybe there is one where you can just write without deleting but I don't know that) you will have to first delete the memory area where you want to write actual data to. The problem is that the smallest erasable memory area typically is a sector (e.g. 4kByte) so if you do not know if this memory was cleared before or if you want to keep data which is outside of your 256 Bytes you will have to read the complete sector to RAM, modify the sector in RAM (write your actual data into this RAM buffer), delete the sector in flash and then write your RAM buffer to the sector in flash.

So this behaviour is not special to FlexSPI - it is because the flash memory you are using is designed that way. After a ChipErase you could write to every memory area once without deleting a sector but as soon as data is written to a memory area you have to clear the memory area before writing new data to it.

Keep in mind what Kerry Zhou mentioned above: if you are executing from the flash you want to delete/write to (XIP) you will have to put your flash access functions in RAM.

Kind regards,

Stefan

1,835 Views
vasudhevan
Contributor V

Hi kerryzhou‌, Stefan,

      Thank you for your brief explanation.

      We have one more doubt how to set change clock 30MHZ or below.

    

flexspi_device_config_t deviceconfig = {
    .flexspiRootClk = 120000000,
    .flashSize = FLASH_SIZE,

      If we change here flex spi clock will change ?

Thanks & Regards,

          Vasu

0 Kudos

1,835 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Vasudhevan G,

   Stefan's reply is correct, you need to modify the XIP folder config.c tool.

pastedImage_1.png

pastedImage_2.png

Wish it helps you!

If you still have questions about it, please kindly let me know.

Best Regards,

Kerry

 

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

1,835 Views
mitterha
Senior Contributor I

Hello Vasu,

no this value is only used to decide how to set up the DLL. The NXP-Boot-ROM will set up the FlexSPI root clock the way you specified it in the struct flexspi_nor_config_t with member "serialClkFreq" e.g. kFlexSpiSerialClk_133MHz.

You can just follow your deviceconfig and check what the NXP driver is going to do with it.

Kind regards,

Stefan

0 Kudos

1,835 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Vasudhevan G

  The flash feature is, if you want to write the flash to the specific area, you need to make sure that area is not written before, otherwise, you need to do the flash erase at first.

   So, even you write to zero, when you want to do another write operation, you need to do the flash erase to that address. This is the general flash character.

Wish it helps you!

If you still have questions about it, please kindly let me know.

Best Regards,

Kerry

 

-------------------------------------------------------------------------------
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