I have a question about the usage of Flash Data Storage, chunks and parsing of the data retrieved from FDS.
- How, when and why are you supposed to use "chunks" when setting up a record? None of the examples I've seen uses chunks, but there must be some good use for it, I guess?
I want to save this data structure as a FDS record:
typedef struct
{
uint16_t sequence_number;
uint32_t timestamp;
uint16_t data;
uint8_t type;
} ble_data_meas_t;
Would I be better off splitting it up into 1-word chunks, or a big 3-word chunk?
-
The length_words parameter. My data is not a multiple of word (32 bits). If I set length_words to 3 when writing the record, will that amount of space be allocated and used for each record, with 0.75 words empty? How can I optimize this? No I need to pad manually, or is this managed in the background?
-
Parsing of retrieved data. I am using fds_record_find and fds_record_open to access records. If I understand correctly, my data will be returned in fds_flash_record_t (a pointer to the place in flash). How do I parse this to put the correct data back into each member of my struct?