Unfortunately it seems my post devzone.nordicsemi.com/.../ has been lost.
This is a re-post.
I am trying to manipulate Flash data in CODE_SPACE one page at a time. Currently I do the following:
-
I set flash_block-> block_id = DFU_BANK_0_REGION_START
and I call register block_count = 36, block_size = 1024 This should register me for Flash between 0x16000 and 0x1F800 -
memcpy the first page of Code space flash into a Ram buffer[1024]. Manipulate the data.
-
pstorage_store to save the RAM buffer back into Flash
-
The first iteration works fine. But on the second loop, I load the second Flash page into RAM, manipulate it and try and save it back into Flash. However the second pstorage_store returns an NRF_ERROR_INVALID_PARAM error everytime. The parameters should be valid as I am passing the base block pointer and set the offset to 1024.
err_code = pstorage_store(flash_block_handle, ram_block, 1024, 1024);
I must be missing something fundamental here, but I don't see it?