This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Able to write only one time in NVMC

Hi ,

Here is my code used to write in to non volatile memory.

#include "nrf.h" //#include "uicr_config.h" #include <stdint.h> #include <stdbool.h> #include "nrf_nvmc.h"

int main(void) {

			uint32_t     address   =  0x10001088;
			uint32_t     value       =  0x13345652;
			uint32_t     b            =   0;
			nrf_nvmc_write_word(address,	value);

			b = *(uint32_t *)address;
			
			//nrf_nvmc_write_word(address+12,	b);
			while (true)
			{
						/* Do nothing */
			}

}

But for first time i able to see the data whatever i have written in memory.

But if i change the value, i cant see the changed data. it remains as old data.

means i am not able to write one more time.

i check by reset the device also , but not able to write.

but if increase address value to 4 more bytes, i am able to write data in new address.

Kindly suggest me, where i am wrong.

Regards Balaji

Parents
  • Hi Ole,

    As you said, we can able to write data's in the non-volatile memory (i.e, flash area that is not used by the application), and i also checked it using keil debugger.

    I tried in different memory locations from 0x028400 to 0x03C800 I can able to erase, read, write.

    But the problem we are facing is when i do power reset the data is getting erased (like volatile memory).

    I am not sure whether i am testing it in correct way or not.

  • If you do a proper NVMC write, the data will not be lost on power-reset, unless you accidentally do an erase on startup. Are you sure that this is not the case? If so, I'd recommend you to include the code you're using and create a new question, since this seems to be an unrelated question to the one here.

Reply Children
No Data
Related