This article describes device specifics of the Infineon XMC4500 microcontroller.
Flash sector limitations
The Infineon XMC4500 device series comes with the following physical sector layout:
- 2 * 64 kB
- 1 * 128 kB
- x * 256 kB
The first 64 KB physical sector consists of four logical 16 KB sectors which can be accessed (erased) individually. Therefore instead of erasing the whole 64 KB physical sector, the first physical sector can be erased 16 KB wise and therefore, e.g. used to have a bootloader which does not change in the first 16 KB logical sector while having the application starting in the second logical sector (offset 16 KB). This way, the application can be exchanged without erasing the bootloader.
However, the J-Link software uses the physical sector layout for two reasons:
- Writing into logical flash sectors disturbs adjacent data in the remaining logical sectors and thus increasing the risk of having incorrect data stored in the remaining memory sectors
- Decrease of total flash erase cycles possible as a logical sector access promotes uneven memory degradation
For further information regarding this, please refer to the technical reference manual of the Infineon XMC4500 series.
However, under special circumstances customers may want to use the logical sector layout. For such scenarios, the J-Link DLL allows to perform a read-modify-write to a flash sector in order to *not* erase certain parts of the physical sector when programming / erasing logical sectors.
Further information regarding this as well as an example can be found here: Link