Creator provide SFLASH writing API (uint32 CySysSFlashWriteUserRow(uint32 rowNum, const uint8 rowData) ) for PSoC 4100 BLE/PSoC 4200 BLE devices, you can find this API in cy_boot-->CyFlash.c, you can call this API directly to write or over-write dedicate SFLASH row.
If the user resets the chip while writing to SFLASH, current SFLASH ROW may be corrupted, because CPU erase current SFLASH row first before writing. No affection to other three SFLASH rows.
If you need to write SFLASH frequently, you may need to care the Flash endurance spec in datasheet, the minimum value is 100K cycles.
Looking from CyFlash.c it says for this function:
"* This API is applicable for PSoC 4100 BLE, PSoC 4200 BLE, PSoC 4100M,
* PSoC 4200M, and PSoC 4200L family of devices."
So not applicable for cyble-022001 module, which I plan to actually use? AFAIK it's a PRoC BLE while the kit has a PSoC 4200 BLE chip.
How will I know will this work or not? I don't have the module yet and I thought PSoC 4200 BLE would be similar enough for testing.
The API in CyFlash.c seems to do about the same as this old example I used, but it does set the parameters differently so you don't have to take care of addresses and row lengths.
Selecting cyble-022001 in PSoC Creator shows just the same CyFlash.c and CyFlash.h still shows 4 rows of SFLASH. Compiles just fine. Works even for PRoC BLE???
Like I wrote in the other thread I'm still very confused about PRoC vs. PSoC. Even cyble-022001 datasheet says " PSoC 4 BLE" while in PSoC Creator it is listed as "PRoC BLE".
100K cycles should be plenty for writing at each reset. Hard to see even 1K cycles to be used.
This module include a PSoC 4100 or 4200 BLE device, SFLASH writing API is available to this module. If it is not available, API is grey color and project cannot pass building without error.