FPGA Intellectual Property
PCI Express*, Networking and Connectivity, Memory Interfaces, DSP IP, and Video IP
6356 Discussions

Generic serial Flash interface sector erase problem

Gyud0
Beginner
919 Views

Hey,

I'm using the Reference design Generic Serial Flash Interface IP on Quartus Prime 18.1 to access Micron MT25QL512Mb flash memory.

Via NIOS processor, I able to erase the memory sector 0 (at address 0x00000000) data correctly in the 4-Byte address mode by the function:

 

void erase_sector_micron()

{

    IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_CSR_BASE,0x7,0x000004DC);

    IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_CSR_BASE,0x9,0x00000000);

    IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_CSR_BASE,0x8,0x1);

}

 

But when I try to erase another sector, like sector 1, I don't see the erasing actually happens:

 

void erase_sector_micron()

{

    IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_CSR_BASE,0x7,0x000004DC);

    IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_CSR_BASE,0x9,0x00010000);

    IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_CSR_BASE,0x8,0x1);

}

 

The sector 1 address is 0x10000 according to page 19 in the Datasheet:

https://media-www.micron.com/-/media/client/global/documents/products/data-sheet/nor-flash/serial-nor/mt25q/die-rev-b/mt25q_qlkt_l_512_abb_0.pdf?rev=0ef0faa5f7b645d7bc11c30bfd27505b

 

 

Gyud0_0-1656843368319.png

 

 

I would like to get some help here,

Thanks

 

 

0 Kudos
8 Replies
Gyud0
Beginner
886 Views

Can you help me please?

0 Kudos
hareesh
Employee
883 Views

hi Gyud0

I am working on it. please give me some time.

 

thanks.

 

0 Kudos
hareesh
Employee
856 Views

hi GAL YUD,

 

please check WRITE ENABLE command is executing or not before initiating ERASE command. in you shared code lines WRITE ENABLE command is not there.

 

thanks,

0 Kudos
Gyud0
Beginner
835 Views

Hi,

I'm executing the write enable command before I initiating the erase command. It's the same order that I do successfully in erase sector 0, the only change is the desired address to be deleted

0 Kudos
hareesh
Employee
819 Views

hi @Gyud0 ,

can you share your code pls

 

thanks,

 

0 Kudos
hareesh
Employee
810 Views

check lock protection enable or disabled. before erase sectors needs to disable lock protection. pls check that. 

0 Kudos
Gyud0
Beginner
794 Views

My code in C:

int main()

{

IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_CSR_BASE,0x7,0x00000006); --Write enable

IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_CSR_BASE,0x8,0x00000001); --Write enable

IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_CSR_BASE,0xA,1); --Write enable

IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_CSR_BASE,0x7,0x000004DC); --Erase sector

IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_CSR_BASE,0x9,0x00010000); --Erase sector

IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_CSR_BASE,0x8,0x00000001); --Erase sector

}

 

 

 

 

0 Kudos
hareesh
Employee
776 Views

Hi @Gyud0 ,

 

It's not a GSFI (Generic Serial Flash Interface) IP driver issue. The GSFI drivers are working fine. Please check Micron MT25QL512Mb flash memory access code because before erasing the sector, you have to disable device lock protection, write command passing, and some other commands also have to execute. In the Micron MT25QL512Mb datasheet, all the details are available. I am giving some  reference example code links for the Micron MT25QL512Mb.

 

link:

https://github.com/STMicroelectronics/stm32-mt25ql512abb 

 

thanks,

0 Kudos
Reply