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

Flash data storage

I am using nrf52832, and used mpu 9250. I want to store the data of mpu 9250 in external and internal flash memory. will you help me how to do this?

the odr of sensor is 100Hz. 

I am confuse about available library fstorage ,pstorage ,fds.

Parents
  • How much data are you planning to store. Running at 100 Hz, I assume it's a quaternion consisting of 4 16 bit signed values, thus 8 bytes, thus 800 bytes per second. FDS is more targeted at storing settings, small amounts of data.

    For this, I would suggest collecting up 4096 bytes and write an entire flash page. Something like 

    	NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen;
    	nrf_nvmc_page_erase((uint32_t) addr);
    	nrf_nvmc_write_words((uint32_t) addr, (uint32_t*) data,	4096 / sizeof(uint32_t));
    	NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren;
    

    Please note the address should be the start of a page.

Reply
  • How much data are you planning to store. Running at 100 Hz, I assume it's a quaternion consisting of 4 16 bit signed values, thus 8 bytes, thus 800 bytes per second. FDS is more targeted at storing settings, small amounts of data.

    For this, I would suggest collecting up 4096 bytes and write an entire flash page. Something like 

    	NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen;
    	nrf_nvmc_page_erase((uint32_t) addr);
    	nrf_nvmc_write_words((uint32_t) addr, (uint32_t*) data,	4096 / sizeof(uint32_t));
    	NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren;
    

    Please note the address should be the start of a page.

Children
Related