9 Replies Latest reply on Dec 23, 2018 7:41 AM by almac_3728656

    2 sectors are erased instead of 1

      Hi,

       

      I'm using S25FL256 connected to stm32f7 via SPI (single mode), and I'm trying to erase sector at address 0x600000.

      The problem is that when I issue the command "sector erase" (0x21), 2 sectors are erased: address 0x600000, and address 0x6F0000.

       

      Here's the sequence of operations:

      tmp_buffer1 = {0,2,4,6,8,10,12,14,16,18}; //10 elements

      //WRITE

      slld_WriteOp(device_num, (ADDRESS)(0x600000), tmp_buffer1, 10, &dev_st);

      slld_WriteOp(device_num, (ADDRESS)(0x6F0000), tmp_buffer1, 10, &dev_st);

      //READ

      slld_ReadOp( device_num, (ADDRESS)(0x600000), tmp_buffer11, 10); // => tmp_buffer11 now has the following data: {0,2,4,6,8,10,12,14,16,18}

      slld_ReadOp( device_num, (ADDRESS)(0x6F0000), tmp_buffer22, 10); // => tmp_buffer22 now has the following data: {0,2,4,6,8,10,12,14,16,18}

      //ERASE

      slld_P4EOp(device_num, (ADDRESS)0x600000, &erase_res); //this is the sector erase operation (0x21)

      //READ

      slld_ReadOp( device_num, (ADDRESS)(0x600000), tmp_buffer11, 10); // => tmp_buffer11 is now all 0xFF

      slld_ReadOp( device_num, (ADDRESS)(0x6F0000), tmp_buffer22, 10); // => tmp_buffer22 is now all 0xFF

       

      The problem happens also in other sectors, for example 0x200000 (which erases also 0x2F0000). Should I try more sectors...?

      The driver code is attached.

       

      Please help... I've been debugging this for days with no avail...

       

      Thanks in advance

       

      Update:

      I noticed that also the opposite happens: erasing 0x6F0000 erases also 0x600000