So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By mazeem
#81664
RichardS wrote:I am not sure why they turn them off, you can try removing the interrupt off and interrupt on functions and see what happens, I would test a lot as it may cause issues on now and again.

I am sure someone else may know better, this is how I would approach it and see.

Code: Select all 
 //noInterrupts();
  if(spi_flash_erase_sector(_sector) == SPI_FLASH_RESULT_OK) {
    if(spi_flash_write(_sector * SPI_FLASH_SEC_SIZE, reinterpret_cast<uint32_t*>(_data), _size) == SPI_FLASH_RESULT_OK) {
      _dirty = false;
      ret = true;
    }
  }
  //interrupts();


RichardS



Thanks for the guidance RichardS. I already have check this method and it resets node-mcu and a unrecognizable error shows on serial monitor with weird exceptions and and numbers....

The good news is the problem has been solved by changing EEPROM Liberary to ESP_EEPROM Liberay https://github.com/jwrw/ESP_EEPROM ... Now it is working normally and storing the values as expected.

Thanks again for your cooperation.