2024-09-24 04:53 PM
I set the Faultmask bit to 1 with the following code snippet and then write 0x5A to an area outside of RAM and read it back.
Since the Faultmask is set to 1, a HardFault does not occur, but the command line I have highlighted is also not being executed.
The processor is not responding at all; I am executing these commands step by step in the debug menu or I want to pause the processor by setting a breakpoint
What could be the cause of the problem? What state might the processor have entered?
MOV R0, #1
MSR FAULTMASK, R0
LDR R0, =0x20002800 ; The address 0x20002800 is outside the RAM area.
MOV R1, #0x5A
STRB R1, [R0]
LDRB R1, [R0] ; !!! PRODUCE HARD FAULT !!! But FAULTMASK BIT=1
MOV R0, #0
MSR FAULTMASK, R0
2024-09-24 05:00 PM
In this line, the processor enters a loop: LDRB R1, [R0]; !!! PRODUCE HARD FAULT !!! But FAULTMASK BIT=1
I want the next command following this instruction to be executed.
2024-09-24 05:36 PM
Perhaps you can increment the PC in the stacked context and return from the Hard Fault?
2024-09-24 06:01 PM
I need to know whether the instruction is 16-bit or 32-bit. In this example, I can determine how many bits the instruction has, but I don't like this solution. I need a general solution