How to erase multiple blocks by LUT command on RT1064

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

How to erase multiple blocks by LUT command on RT1064

Jump to solution
1,537 Views
rickyrocky
Contributor I

Hi All, and @victorjimenez 

I am using evkmimxrt1064_fsl_romapi example.

romapi does not support erase block, so I intend to do it via LUT command.

Result is, just ONE block is erased. Could you tell me how to define to erase multiple blocks? (there is no parameter to specify block size or block num)

Solution:

In flexspi_nor_polling_transfer example, refer to flexspi_nor_flash_erase_sector() function.

Call this function several times for multi-erase.
0 Kudos
Reply
1 Solution
1,485 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @rickyrocky ,

The example call erase_sector function by 

 status = flexspi_nor_flash_erase_sector(EXAMPLE_FLEXSPI, (EXAMPLE_SECTOR + j) * SECTOR_SIZE);

EXAMPLE_SECTOR is the start sector. You can replace it with your start block. If you want to erase several block, just call your flexspi_nor_flash_erase_block several times. That's it.

 

Regards,

Jing

View solution in original post

0 Kudos
Reply
5 Replies
1,478 Views
jay_heng
NXP Employee
NXP Employee

Flash block can only be erased one by one. there is not multiple blocks erase command.

0 Kudos
Reply
1,468 Views
rickyrocky
Contributor I

Hi @jay_heng 

Thanks for your information.

0 Kudos
Reply
1,499 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @rickyrocky ,

You can refer to the flexspi_mor_polling_transfer example. Add block erase command to LUT and refer to the flexspi_nor_flash_erase_sector() function.

 

Regards,

Jing

0 Kudos
Reply
1,493 Views
rickyrocky
Contributor I

Hi @jingpan 

Thanks for your reply soon.

I had also referred to  flexspi_nor_polling_transfer example before, but it does not solve my issue.

status_t flexspi_nor_flash_erase_sector(FLEXSPI_Type *base, uint32_t address)
 
The "address" argument is operation sector address, and I can not see the sector number or sector size in this function. Therefore, ONE flexspi_nor_flash_erase_sector() call, ONE sector erase.
 
I want to erase multi-sector, could you tell me the detail?
0 Kudos
Reply
1,486 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @rickyrocky ,

The example call erase_sector function by 

 status = flexspi_nor_flash_erase_sector(EXAMPLE_FLEXSPI, (EXAMPLE_SECTOR + j) * SECTOR_SIZE);

EXAMPLE_SECTOR is the start sector. You can replace it with your start block. If you want to erase several block, just call your flexspi_nor_flash_erase_block several times. That's it.

 

Regards,

Jing

0 Kudos
Reply