Hello Giovanni,
Both burst programming and byte-by-byte programming require a similar sequence and actions.
The main difference is that, for burst programming, the next address and byte value is written to flash memory after FSTAT_FCBEF flag becomes set, indicating that the buffer is ready the new data. At this point, the programming voltage is still present on the flash row, and the flash array remains inaccessible to read operations. This means that the code to increment the address, and write the new address and data value, must also reside within RAM, perhaps on the stack, along with code to launch the programming command and test the flags.
For byte-by-byte programming the programming process for the current byte is completed when FSTAT_FCCF flag becomes set. This happens some time after FSTAT_FCBEF becomes set, which accounts for the additional time taken. At this point, the programming voltage has been removed from the flash array, so is now available for read operations. This means that code to increment the address, and write the new address and data value, may reside within flash memory, in the normal manner. Only the code to launch the programming command and test the flags need reside within RAM, requiring many fewer bytes of RAM resident code.
For programming each 32 bytes, there will be the following timing differences for the total programming time, ignoring code execution overheads. The range of values takes into account the allowable limits for the flash clock frequency (150 - 200 kHz).
Burst programming 690 - 920 microseconds
Byte-by-byte programming 1440 - 1920 microseconds
Page erase time 20 - 27 milliseconds
Since you are not restricted to a single row for the byte-by-byte programming, the address sequence can be totally random, and does not need to commence at a row boundary.
If you are storing the current flash data page in RAM, and then erasing the page, at this point you are vulnerable to power failure occurring, and the loss of the current data. One method to counter this is to store the same data within two different flash pages, then erase and program one page at a time. You may want to include a CRC check value within your data so that you know the page programming is complete and intact.
Regards,
Mac