Hello,
I am working on an update of older FW implementation: nRF52832, SDK 14.1.0, with SoftDevice S132 and using BLE connection.
The change I need to implement is a functionality for writing a bigger block of data, around 20kB to flash. These data will be written after every use of the device. The flash space available I have is about 160kB - above application and below bootloader (0x4A000 - 0x72000).
Before starting implementation itself I need to clarify several questions.
As I'd like to reflect flash endurance my first choice is using FDS driver utilizing SD. Having the flash space available it could be 8 data blocks written then the driver should start form beginning again.
Questions:
- How the FDS driver knows / checks the flash limits? Does the SD provides this information?
- From some posts I understood that the FDS starts below bootloader area towards lower addresses. Correct?
- How is the unused flash used during DFU over BLE (temporary storing of new image)? I guess that it will conflict with my data. It might not be a problem the data will be erased during DFU.
- Does the DFU ignore there are some data in the flash or it will not allow running DFU if not enough space?
- Where are BLE data (bonding) stored? Is it somewhere inside SD area or in the free flash space (a page below bootloader)?
Another approach is to use fstorage driver and implement all the flash buffer handling myself. Advantage is that I can handle myself the flash limits and I have better overview on space available and data location.
I am using WDT and the WDT interrupt driver handles writing some important data (48 B) into flash. As there is a short time window (like 36 ms?) while the device restarts, I use fstorage driver for writing the data as I find it a faster driver.
A question: is it possible to have both flash drivers initialized at the same time and to use the one that is appropriate?
If there is any documentation on the above questions it would help me.
Thank you for any advices.
Best regards,
peter