RTA Knowledge Base

Why Fee initialization takes too long

One of the reason why the Fee Intialization might take too long, is that in the Fee module integration code there is a sample implementation of the function Fee_Fls_SyncRead(), called multiple times during Fee initialization.

The sample implementation calls the Fls MainFunction and this might take multiple cycles to complete.

The user can implement its own strategy to optimize the start-up times.

Possible implementation

You can try to use the function rba_BswSrv_MemCopy8 to directly make a memcopy instead of calling the fls mainfunction each time.

Another possible solution can be to use the appropriate MCAL functions for the same purpose (as it is also suggested in the integration code comments).

A possible implementation is the following:

Code
#include "rba_BswSrv.h";
/**
 *********************************************************************
 * Fee_Fls_SyncRead(): Service for synchronous data read
 *
 * This function performed synchronous read data from Data Flash.
 * Below is a template implementation. Integrators shall
 * implement this function in order to match with the target MCAL.
 *
 * \param    SourceAddress:     Relative address of the data to be read in flash memory.
 * 								This address offset will be added to the flash memory base address.
 * \param    TargetAddressPtr:  Pointer to target data buffer.
 * \param    Length:            Length in bytes to be read from Data Flash memory.
 * \return   Function success
 * \retval   E_OK:              Read command has been accepted.
 * \retval   E_NOT_OK:          Read command has not been accepted.
 * \seealso
 * \usedresources
 *********************************************************************
 */

Std_ReturnType Fee_Fls_SyncRead( Fls_AddressType SourceAddress,
                                uint8 *TargetAddressPtr,
                                Fls_LengthType Length
                               )
{
  
	Std_ReturnType RetVal = E_OK;

	if(TargetAddressPtr == NULL_PTR)
	{
		RetVal = E_NOT_OK;
	}else{
		rba_BswSrv_MemCopy8(TargetAddressPtr, FLS_BASE_ADDRESS + SourceAddress, Length);   
	}

	return RetVal;
}