The number of times to erase flash reaches a million times by FS or NVMC

hi,

I am testing the flash erasing times of nRF52832, and i find that the minimum times of flash erase\write are 10000 documented in the data sheet.

I konw the times are tested at very high temperature(non-normal temperature), so I 'm curious about how many times of flash erase/write are at room tempetature.

The FS and NVMC are programing  and downloaded in the nRF52832 chip.

The erase times can get by J-link RTT Viewer, and the codes generate random numbers and write them to flash.

Just pay attention to this times of flash erase (the red arrow is marked) .

Regarding the question:

1) are the times right? Why is it that the flash is still not damaged after so many erases? 

2) if not, could i know the times of flash erase/write  at room tempetature?

3) are the codes right attached the end of the page?

FS code log: run many times and reset by manual (erase times more than a million times in total)

NVMC code log: erase times more than a million times in total

FS code:

while(true)
	{
		NRF_LOG_FLUSH();
		NRF_LOG_INFO("\n =============================================== ");
		
		uint8_t p_buff[RANDOM_BUFF_SIZE];
    uint8_t length = random_vector_generate(p_buff,RANDOM_BUFF_SIZE);
		
		NRF_LOG_INFO("Write Random Vector:");
		NRF_LOG_HEXDUMP_INFO(p_buff, length);
		NRF_LOG_INFO("");
		NRF_LOG_FLUSH();
        
		nrf_delay_ms(20);
		
		memcpy(my_fs_info.write_data, p_buff, length);
		my_fs_info.write_len = length;
    nrf_delay_ms(100);
		
		
		// flash write
		if((my_fs_info.need_write == true) && (my_fs_info.busy == false)&&(reverse_flag == false))
		{			 
				if((write_err_cnt > 100) || (erase_err_cnt > 100))
				{
						NRF_LOG_INFO(" ==== write enough!!!! ====");
						NRF_LOG_INFO(" ==== write enough!!!! ====");
						continue;
				}
				if(my_fs_info.write_len == 0)
				{
						continue;
				}
				my_fs_info.busy = true;  
			  my_fs_info.need_write = false;
				my_fs_info.need_read = true;
				reverse_flag = true;
			 
				NRF_LOG_INFO("Address: %08X", FLASH_START_ADDR);
				rc = nrf_fstorage_write(&my_fs, FLASH_START_ADDR, &my_fs_info.write_data, my_fs_info.write_len, NULL);
				if(rc != NRF_SUCCESS)
				{
					write_err_cnt += 1;
					NRF_LOG_INFO("== fs write error: 0x%x",rc);	
				}
				else
				{
					write_cnt += 1;
					NRF_LOG_INFO(" === write count: %d", write_cnt);
				}
		}
		
		// flash read
		if((my_fs_info.need_read == true)&&(my_fs_info.busy == false))
		{
				my_fs_info.need_read = false;
			  
				rc = nrf_fstorage_read(&my_fs, FLASH_START_ADDR, &my_fs_info.read_data,256);
			  
			  if(rc != NRF_SUCCESS)
				{
					NRF_LOG_INFO("0x%x",rc);
				}
				else
				{
					NRF_LOG_INFO("Read Flash Data:");
					NRF_LOG_HEXDUMP_INFO(my_fs_info.read_data, RANDOM_BUFF_SIZE);				  					
				}
		}
		
		// flash erase
		if((my_fs_info.need_write == false) && (my_fs_info.busy == false)&&(reverse_flag == true))
		{				
				if((write_err_cnt > 100) || (erase_err_cnt > 100))
				{
						NRF_LOG_INFO(" ==== erase enough!!!! ====");
						NRF_LOG_INFO(" ==== erase enough!!!! ====");
						continue;
				}
				my_fs_info.need_read = true;
				my_fs_info.need_write = true;
				my_fs_info.busy = true;
				reverse_flag = false;
				rc = nrf_fstorage_erase(&my_fs, FLASH_START_ADDR, 1, NULL);
				if(rc != NRF_SUCCESS)/
				{
					erase_err_cnt += 1;
					NRF_LOG_INFO("== fs erase error: 0x%x",rc);
				}
				else
				{
					erase_cnt += 1;
					NRF_LOG_INFO(" === erase count: %d", erase_cnt);
				}
		}

		idle_state_handle();
	}
}

NVMC code:

while(status)  
{     
      addr = 0x00072000;
      nrf_nvmc_page_erase(addr);
      nrf_nvmc_write_word(addr,src_value);
      pdat = (uint32_t *)addr;
        
      NRF_LOG_INFO("0x%x was read from flash\r\n", *pdat);
      
      if((*pdat) != src_value)
      {
          status = false;
        
          NRF_LOG_INFO(" ===== Flash Error !!! =====");
          NRF_LOG_FLUSH();
          break;
      }
      opt_cnt += 1;
      NRF_LOG_INFO(" ===== flash operation : %d", opt_cnt); 
      NRF_LOG_FLUSH();
  }
}

best wishes,

thanks.

  • Hi 

    1) are the times right? Why is it that the flash is still not damaged after so many erases? 

    The quoted numbers in the datasheet are the worst case values, which has to take things like different temperatures, different supply voltages, production variations and the effects of aging into account. Tests on a small number of devices in lab conditions will always show better results. 

    And even if no errors can be detected now you might still experience reliability issues after some time has passed, or if you change the operating environment. 

    2) if not, could i know the times of flash erase/write  at room tempetature?

    We don't test explicitly for this, so we don't have any values to share unfortunately. The general recommendation is to design for the worst case (minimum) listed in the documentation, and make sure your application will work well even if the worst case hits. 

    3) are the codes right attached the end of the page?

    They code looks OK to me. Did you measure the timing of the erase call? 

    It could take as much as 20-80ms to run a single page erase, and as such running more than a million page erase cycles should be quite time consuming to test. 

    Is there any particular reason you need such a high amount of erase cycles? 
    Are you continuously storing large amounts of data to flash?

    Best regards
    Torbjørn

  • Dear Torbjorn,

    thanks for your prompt reply.

    1) Is there any particular reason you need such a high amount of erase cycles? 

    I just wanted to test the approximate range of Flash erase/write times at room temperature, so it just to test the flash that the chip has been powered up.  The actual function does not need to be such a high amount of erase cycles.

    2) Are you continuously storing large amounts of data to flash?

    no, some peer data are stored in the flash, and continuous storage is alse not required.  The product needs to have a life span of more than 10 years, and the life cycle of Flash needs to be tested and verified in order to ensure the use cycle of product.

    I got it, and I agree with your opinion. I will design product features based on the minimum number of datasheet.

    Best wishes,

    Phineas

  • Hi Phineas

    Glad I could help Slight smile

    I will consider the case resolved then, unless you have more questions. 

    Best regards
    Torbjørn

Related