On using FlsLoader_Write(0x80640000, 32, &alignedPageBuffer) API to write a page in PFLASH2 of AURIX TC397XX, Program Fetch Synchronous Error (PSE) Trap is occurred and Fetch Bus Error (FBE) is raised in CPU->CPU0->PMI->PSTR (Program Synchronous Trap Register).
After debugging I figured out that any assembly instruction (e.g., ld16.w, addi, ige.u, sh and etc) at P:0x80022940 causes this issue.
If I placed a loop that contains __asm__ volatile ("nop" ::: "memory") before the line causing the issue (so that the code below the loop is shifted away from 0x80022940), the trap NOT occurred. However, the data did not reflected to the memory (although FlsLoader_Write returns E_OK and PMU->DMU->ERRSR register is 0x0)
I need to know why this is happening to solve it permanently.
As this is part of MC-ISAR, which is licensed, this topic cannot be discussed in a public forum. We request you to please get in touch with your local Infineon, distributor, or software reseller contact.