How to erase multiple blocks by LUT command on RT1064

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

How to erase multiple blocks by LUT command on RT1064

跳至解决方案
1,382 次查看
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 项奖励
回复
1 解答
1,330 次查看
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 项奖励
回复
5 回复数
1,323 次查看
jay_heng
NXP Employee
NXP Employee

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

0 项奖励
回复
1,313 次查看
rickyrocky
Contributor I

Hi @jay_heng 

Thanks for your information.

0 项奖励
回复
1,344 次查看
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 项奖励
回复
1,338 次查看
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 项奖励
回复
1,331 次查看
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 项奖励
回复