Hi,
I'm trying to use the Flash API 021 (F021_API_CortexR4_BE_V3D16.lib) with the TMS570LS3137. Whenever calling a function from the Fapi Library I get a prefetchEntry Interrupt.
There seem to be quite a few entries in this Board about the same problem. So, I already checked following points:
- Running wrapper function out of RAM (Linker Command File and wrapper function attached below)
- Flushing Pipeline after last Fapi Function Call with Fapi_flushPipeline()
- Changing MPU Permission to Read/Write
- Using privileged Mode for Fapi Function Execution
Do you have any further ideas what could cause the probelm ?
Thank you very much for your Help
Best Regards
Thomas
Software used:
- HALCoGen04.05.01
- CCS 6.1.1.00022
void useFlashApi() { Fapi_StatusType oReturnCheck = Fapi_Status_Success; oReturnCheck = Fapi_initializeFlashBanks(160); // Example code is assuming operating frequency of 160 MHz // if((oReturnCheck == Fapi_Status_Success) && (FLASH_CONTROL_REGISTER->FmStat.FMSTAT_BITS.BUSY != Fapi_Status_FsmBusy)) { oReturnCheck = Fapi_setActiveFlashBank(Fapi_FlashBank0); Fapi_enableMainBankSectors(Fapi_FlashBank0); // Place specific example code here // // Wait for FSM to finish // while(FLASH_CONTROL_REGISTER->FmStat.FMSTAT_BITS.BUSY == Fapi_Status_FsmBusy); // Check the FSM Status to see if there were no errors // if (FLASH_CONTROL_REGISTER->FmStat.u32Register != 0) { // Put Error handling code here // } } Fapi_flushPipeline(); }
--retain="*(.intvecs)" MEMORY { VECTORS (X) : origin=0x00000000 length=0x00000020 FLASH_API (RX) : origin=0x00000020 length=0x000014E0 FLASH0 (RX) : origin=0x00001500 length=0x002FEB00 //LS31x and RM48 Flash size is 0x300000 SRAM (RW) : origin=0x08002000 length=0x0002D000 STACK (RW) : origin=0x08000000 length=0x00002000 } SECTIONS { .intvecs : {} > VECTORS flashAPI : { ..\Release\Fapi_UserDefinedFunctions.obj (.text) ..\Release\bl_flash.obj (.text) --library= F021_API_CortexR4_BE.lib < FlashStateMachine.IssueFsmCommand.obj FlashStateMachine.SetActiveBank.obj FlashStateMachine.InitializeFlashBanks.obj FlashStateMachine.EnableMainSectors.obj FlashStateMachine.IssueFsmCommand.obj FlashStateMachine.ScaleFclk.obj Init.obj Utilities.CalculateEcc.obj Utilities.WaitDelay.obj Utilities.CalculateFletcher.obj Read.MarginByByte.obj Read.Common.obj Read.FlushPipeline.obj Read.WdService.obj Async.WithAddress.obj Program.obj > (.text) } load = FLASH_API, run = SRAM, LOAD_START(api_load), RUN_START(api_run), SIZE(api_size) .text > FLASH0 .const > FLASH0 .cinit > FLASH0 .pinit > FLASH0 .data > SRAM .bss > SRAM }