25.6.8.7 SmartEEPROM Sector Reallocation
By default, the SEES reallocation is performed in hardware when the next available page in the Host index reaches the maximum SEEP number. Automatic reallocation can be disabled by writing a one in SEECFG.APRDIS. The sector reallocation can also be triggered manually by issuing the SEERALOC command. The SEES reallocation process consists of the following:
- Erase the non-active sector.
- Copying valid data from the active sector to another sector, old data is filtered.
- Swap ASEES either by issuing the ASEES1 command if SEESTAT.ASEES is reading ‘0’ or by issuing the ASEES0 command if SEESTAT.ASEES is read as ‘1’.
By default, this process is automatically handled by hardware, and indicated by the SEESTAT.BUSY flag. If in buffered mode, the page buffer must be flushed before triggering a reallocation; otherwise, the content of the pagebuffer will be lost.
- The BKSWRST command triggers automatically the reallocation algorithm which operates as described above except copy is done in the same active sector but in the first bank. This operation is atomic, meaning that no modify operation can be issued in the mean time.
- At the end of reallocation, there may be a CPU stall for a few milliseconds. Critical code can be placed in TCM, RAM, or CMCC.
As the total size of the whole SEEP exceeds the SmartEEPROM virtual size for a given configuration, there is always free SEEP to replace existing data. In the case all addresses have been written, after sector reallocation the number of free SEEP is given in the following table.
| SEESTAT.PSZ: SEESTAT.SBLK | 4 | 8 | 16 | 32 | 64 | 128 | 256 | 512 |
|---|---|---|---|---|---|---|---|---|
| 0 | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A |
| 1 | 16 | 16 | 16 | 16 | 31 | 15 | 7 | 3 |
| 2 | 16 | 16 | 16 | 16 | 16 | 47 | 23 | 11 |
| 3 | 16 | 16 | 16 | 16 | 16 | 16 | 23 | 11 |
| 4 | 16 | 16 | 16 | 16 | 16 | 16 | 55 | 27 |
| 5 | 16 | 16 | 16 | 16 | 16 | 16 | 16 | 11 |
| 6 | 16 | 16 | 16 | 16 | 16 | 16 | 16 | 27 |
| 7 | 16 | 16 | 16 | 16 | 16 | 16 | 16 | 43 |
| 8 | 16 | 16 | 16 | 16 | 16 | 16 | 16 | 59 |
| 9 | 16 | 16 | 16 | 16 | 16 | 16 | 16 | 11 |
| 10 | 16 | 16 | 16 | 16 | 16 | 16 | 16 | 16 |
