This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Instruction Fault Generation

Hi Experts,

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.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// assign random location
unsigned int *test_addr = 0x100;
// Overwrite the address with invalid instruction
*test_addr = 0xFFFFFFFF;
// declare function pointer
char (*func_ptr)(void);
func_ptr = 0x100;
// Try to execute instruction from 0x100 location
func_ptr();
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

0