SPRADL4 January 2025 F29H850TU , F29H859TU-Q1
This function encapsulates all standard device and FlashAPI setup.
First, it initializes the device and its peripherals.
Device_init();
Flash_initModule(3);
Device_initGPIO();
Interrupt_initModule();
Interrupt_initVectorTable();
__asm(" ENINT")
Then, it requests the flash semaphore and initializes the Flash API with the chosen user configuration.
HWREG(SSUGEN_BASE + SSU_O_FLSEMREQ ) = 1;
while ((HWREG( SSUGEN_BASE + SSU_O_FLSEMSTAT) & SSU_FLSEMSTAT_CPU_M)!= (0x1<<SSU_FLSEMSTAT_CPU_S));
u32UserFlashConfig = Fapi_getUserConfiguration(BankType, FOTAStatus);
Fapi_SetFlashCPUConfiguration(u32UserFlashConfig);
oReturnCheck = Fapi_initializeAPI((Fapi_FmcRegistersType*) FLASHCONTROLLER1_BASE, 200);
if(oReturnCheck != Fapi_Status_Success)
{
Sample_Error();
}