AM261x MCU+ SDK: FSS

| AM261x MCU+ SDK 26.00.00 |

FSS

# Usage of FSS driver

FSS driver is used to configure bootseg IP and ECCM IP.

Bootseg IP is used to perform A/B swap in Firmware-Update-Over-The-Air (FOTA) application. Please refer to Technical Resource Manual of the deivce for more details of this IP.

ECCM is on-the-fly-Ecc module which perform ECC check on the fly which makes XIP from external flash secure. Please refer to Technical Resource Manual of the deivce for more details of this IP.

# Example Usage

## Configuring FSS for Bootseg peripheral

Includes the following files

#include <drivers/fss.h>
#include <drivers/hw_include/cslr_fss.h>

Initilize the following struct

FSS_Config fssConf;
/* IP base addrress is defined in the CSL files */
fssConf.ipBaseAddress = CSL_MSS_CTRL_U_BASE;
/* Assume that size of external flash is 32MB */
fssConf.extFlashSize = 32 * 1024 * 1024;;

Note that, ipBaseAddress address is in CSLR file.

To remap 2nd half of flash to 1st half of the flash (or boot from 2nd half of flash.)

DebugP_assert(FSS_selectRegionB(&fssConf) == SystemP_SUCCESS);

To boot from 1st half of flash,

DebugP_assert(FSS_selectRegionA(&fssConf) == SystemP_SUCCESS);

Somtimes, it is requried to find from which part of flash, application boots from. Following code snippet shows that:

uint32_t bootRegion = FSS_getBootRegion(&fssConf);
if(1U == bootRegion)
{
DebugP_log("Booting from 2nd half of flash (or B region).");
}
else
{
DebugP_log("Booting from 1st half of flash (or A region).");
}

## Configuring FSS for ECCM

FSS_ECCRegionConfig region;
/*
ECCM IP can config 4 regions. Index is to indicate
for which region this config is for.
*/
region.regionIndex = 0;
region.size = 1 * 1024 * 1024;
region.startAddress = 16 * 1024;
/* disable ECC initially */
FSS_disableECC();
FSS_configECCMRegion(&region);
FSS_enableECC();

make sure to disable ECC before configuring it.

# API

APIs for FSS

FSS_Config
Definition: fss.h:92
FSS_configECCMRegion
int32_t FSS_configECCMRegion(FSS_ECCRegionConfig *parameter)
Configure en ECCM Region.
FSS_ECCRegionConfig::size
uint32_t size
Definition: fss.h:85
FSS_ECCRegionConfig::regionIndex
uint32_t regionIndex
Definition: fss.h:87
FSS_Config::ipBaseAddress
uint32_t ipBaseAddress
Definition: fss.h:93
FSS_ECCRegionConfig
Definition: fss.h:84
FSS_ECCRegionConfig::startAddress
uint32_t startAddress
Definition: fss.h:86
DebugP_log
#define DebugP_log(format,...)
Function to log a string to the enabled console.
Definition: DebugP.h:235
FSS_selectRegionB
int32_t FSS_selectRegionB(FSS_Handle handle)
Map region N of flash to initial position.
FSS_disableECC
void FSS_disableECC(void)
Disable ECC.
SystemP_SUCCESS
#define SystemP_SUCCESS
Return status when the API execution was successful.
Definition: SystemP.h:56
FSS_Config::extFlashSize
uint32_t extFlashSize
Definition: fss.h:94
FSS_getBootRegion
uint32_t FSS_getBootRegion(FSS_Handle handle)
Which boot region is been selected.
DebugP_assert
#define DebugP_assert(expression)
Function to call for assert check.
Definition: DebugP.h:187
FSS_enableECC
void FSS_enableECC(void)
Enable ECC for Flash.
FSS_selectRegionA
int32_t FSS_selectRegionA(FSS_Handle handle)
Map region A of flash to initial position.