Is there any sample code or way to generate the Instruction Fault by forcing the processor (Cortex R).
For Example, I tried below but no updates in IFSR (instruction fault status register). But when I tried to access the MPU region access with "No Execute" permission pre-fetch abort occurs.
// assign random location
unsigned int *test_addr = 0x100;
// Overwrite the address with invalid instruction
*test_addr = 0xFFFFFFFF;
// declare function pointer
func_ptr = 0x100;
// Try to execute instruction from 0x100 location
Did you try to create a real undefined instruction. Takeing the TRM, it lists conditions which cause an undefined instruction exception. Likely more efficient than just poking anything into the memory.
I tried with real "undefined" instruction, but it just takes the Undefined Exception but no updates in Instruction fault status (IFSR) register. But same update (IFSR) happens when Prefetch abort occurs.
Question is, list of CPU registers which get affected when Undefined instruction, Data and instruction pre-fetch happens.
View all questions in Cortex-R / R-Profile forum