Hi All,
We are in design phase of our project, which uses two NRF52 chipset one as master and Central , We have some prewritten content in Flash, which need to be read when BLE connection is up. So am currently working on checking how much time it will take to read 256 KB from Flash, Here is my test code for write and read ........ Am using memcpy for read and write in Flash. Is this correct way ?
// flash write
static void flash_write(uint32_t * address, char * value) { // Turn on flash write enable and wait until the NVMC is ready:
NRF_NVMC->CONFIG = (NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos);
while (NRF_NVMC->READY == NVMC_READY_READY_Busy)
{
// Do nothing.
}
memcpy(address,value,4096);
while (NRF_NVMC->READY == NVMC_READY_READY_Busy)
{
// Do nothing.
}
// Turn off flash write enable and wait until the NVMC is ready:
NRF_NVMC->CONFIG = (NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos);
while (NRF_NVMC->READY == NVMC_READY_READY_Busy)
{
// Do nothing.
}
}
// flash read
memcpy(a,addr,1024);
Thanks a Lot in Advance