One of the key component of Firmware Updated-Over-Air (FOTA) is to switch to a new verison of firmware. BootSeg hardware IP has been added in the SOC to alows this switching to the other image. Bootseg IP is part of FSAS area of SOC. The following image shows the location of bootseg hardware block as part of FSAS.
In the above image, all CPU transactions are coming on VBUSM interface and going to 64M to 128M
protocol converter hardware block. After that it goes to BootSeg hardware block which does the address translation.
On the same data path there is OTFA+ECCM
hardware block which is safety and security block (see OptiFlash Memory Technology). Then there is FOTA IP at the bottom. At the end, right side of the above image, is the flash controller (OSPI0).
The main idea is, at a time, the flash is divided into 2 region. Suppose that flash is 32MB then 1st region is from 0 to 16MB and then 2nd region is from 16MB to 32MB. A valid image can be in any of the region and it is required to boot either from region 1st or region 2nd without application being aware from which region it is being boot from. To achieve this, all address are required to be translated to the correct region.
The following image shows the same:
It is easier to talk in terms of absolute numbers. That is, there are 2 regions in the flash from which application can boot viz. 0-16MB and 16MB - 32MB (for a flash of 32MB in size) and at boot time, it is required to set one region as Active region and other one as backup region or Region A and Region B. Bootseg IP, is then used to make either
Please note that here, we are assuming that size of flash is 32MB and each region size is half of size of flash here.
In the fss driver source\drivers\fss\v0\fss.h
there is an API called FSS_selectRegionA
which will select 1st half of flash as the boot region or Active region and applicaton need to make sure to write in region B of the flash.
In the fss driver source\drivers\fss\v0\fss.h
there is an API called FSS_selectRegionB
which will select 2nd half of flash as the boot region or Active region and applicaton need to make sure to write in region B of the flash.