Hello,
I'm hoping that I missed something in the code and not something that might be inherent with nus and fds.
Combining SDK 15.3 template, uart and fds examples, with some additional code from Vidar in this case,
I can get write, delete, erase and fds stats working fine, as the functions nicely execute one after the other.
Flash a DK32 with the attached SES code, press reset on the DK a couple of times, and results are displayed as follows.
<00> info> app: void fds_record_write_1(void)
<00> info> app: Event: FDS_EVT_WRITE received (NRF_SUCCESS)
<00> info> app: FDS_EVT_WRITE DONE
<00> info> app: rec_id var1 var2 var3 var4
<00> info> app: 1 AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD
<00> info> app: Record written.
00>
<00> info> app: void fds_file_delete_1(void)
<00> info> app: Event: FDS_EVT_DEL_FILE received (NRF_SUCCESS)
<00> info> app: FDS_EVT_DEL_FILE here
<00> info> app: FDS_EVT_DEL_FILE DONE
<00> info> app: File deleted.
00>
<00> info> app: void fds_file_erase_1(void)
<00> info> app: Event: FDS_EVT_GC received (NRF_SUCCESS)
<00> info> app: FDS_EVT_GC DONE
<00> info> app: File erased.
00>
<00> info> app: void fds_flash_usage_1(void)
<00> info> app: Found 0 valid records.
<00> info> app: Found 0 dirty records (ready to be garbage collected).
<00> info> app: Found 3 pages available.
<00> info> app: Found 4 words used.
<00> info> app: Found 1022 largest contig.
<00> info> app: Found 0 freeable words.
<00> info> app: Found 0 freeable words (bytes).
<00> info> app: Stat displayed.
00>
When trying to write a record using nus rx, I'm getting an endless loop at "while (!fds_record_write_flag);".
This is done by using nRF Connect, with DK connected, click UART RX characteristic, tab to Unsigned, enter '1', and Write.
[enter: 1 (write record), 2 (file delete), 3 (erase), 4 (record delete), 5 (stat) ]
File delete seems to work fine when called by nus if no valid records exist.
But if there are valid records, file delete gets into a loop.
Write, erase, and record delete are always in a loop. Stat works fine in all cases.
I tried switching from bool to unint8_t for the while flags, changed void and static on the functions, changed while loop structures,
and also tried using nRF Connect for android, and sdk 17.0.2, but same endless loop results as 15.3 and ios.
All good when functions are run from main(), but not so good when called from nus rx.
thank-you,