Good health to all!
I am using Ble, I need to flash received packets.
The best way to do this is using sd_flash_write ().
In the sdk_config.h file, I see #define NRF_FSTORAGE_SD_MAX_WRITE_SIZE 4096 for nRF52 (and 1024 for nRF51).
But where can I set the write block size without fstorage? At the moment it is 1024, which I checked empirically. Is this the maximum value? But nrf_nvmc_write_bytes () allows you to write a whole page, all 4096 bytes at a time.
If, when receiving a message, I call the erase and write function, everything will break due to the slow softdevice.
Therefore, I clear all the pages I need for subsequent writing at the very beginning of the program. But in this case, sd_flash_write () does not fire.
My writing algorithm is that each incoming packet carries me 128 bytes, which I accumulate 8 times in an array of 1024 bytes. And every 8th reception of the message I call the sd_flash_write function (app_flash.addr, app_flash.buffer, 1024);
The second reason why I cannot use sd_flash_page_erase () (and this could be called, for example, every 7th reception of a message) is that the function erases 4096 bytes, and I need to prepare a field for 1024 bytes, because these are possibilities softdevice.
What should I do? How can I establish convenient communication with softdevice and record a buffer for receiving Ble messages?