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

Updating CONTROL triggers bus fault on SC300 core

Hello forum,

I am doing some tests on a ARM SC300 microcontroller. In a particular test, I need to switch to user execution from privileged execution (in thread mode). The code looks quite straight-forward as follows:

mrs r1, CONTROL    ; copy CONTROL to r1
mov r2, #1
orr r1, r1, r2     ; r1[0] = 1
msr CONTROL, r1    ; CONTROL[0] = 1 so that we will be in user mode
isb                ; flush instruction pipeline

What bothers me is that the instruction "msr CONTROL, r1" triggers bus fault. I did some checking and bus fault is triggered twice. The fault status said that for the last fault, it is a precise fault and the fault address is 0xE000E280 which is IRQ 0~31 clearing register.

I read around manual and internet but have not found any clue. If any of fellow forum members could give me any hint, I will appreciate it very much.

Thank a lot in advance.