d00616 / arduino-NVM

Direct flash memory access, round robin virtual pages and EEPROM like memory.
GNU Lesser General Public License v2.1
25 stars 4 forks source link

Data write not persisting #6

Open jLynx opened 3 years ago

jLynx commented 3 years ago

Hi I am having trouble getting data I write to stay as each time I try to read it back after restarting its not there anymore.

  char* testword_in;
  char* testword = "TestWord";

  //  NVRAM.write_block((uint8_t *)&testword, 0, sizeof(testword));
  NVRAM.read_block((uint8_t *)&testword_in, 0, sizeof(testword));
  print_compare((uint32_t)testword, (uint32_t)testword_in);

This is what I am using to test. I will uncomment the write line and run the code. It will return "OK" but then I comment out the write line and test it again and it fails and returns "ERROR".

II am testing this on a NRF51822. Is there something I am doing wrong here?