According https://www.omo-ic.com/ to the information on the Internet, the lifetime of a single NOR Flash address is affected by the number of times of erasing. To be more specific, each bit on a single address is independent. For example, the address 0x08011000 has a total of 8 bits. Suppose I keep looping the data of this address to 0x01 and 0x00. Then the bit0 bit will be erased all the time. After tens of thousands of cycles, the bit 0 bit may be damaged and cannot be erased. However, bit0 corruption does not affect the function of other bits, such as bit1, or it can be used normally.
1 of 1 people found this helpful
If you want to write larger data (>127k) during an active BLE connection, you need to be aware that the flash write function does not write all 127k in each flash write function call. In this case, you will block the "main loop" for a long time. According to the BLE documentation, to maintain a BLE connection, you must call Cy_BLE_ProcessEvent() at least once per connection interval(CI) and do not block the BLESS interrupt. Therefore, you need to implement some state machines and write 1 row (512b) per call of your flash write function, otherwise you will have disconnection by reason CONNECTION_TIMEOUT. You can look at Cy_BLE_StoreAppData function or implement similar..
Also you will need to modify the Linker script (*.ld) to use some part from "Application flash" section for your "Flash_Storage" (see example in Linker script how it done for 'em_eeprom' section).