MCF5206 privilege violation

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

MCF5206 privilege violation

1,090 次查看
NE555
Contributor I
Hi

I've encontered a strange problem when trying to change privilege level on a MCF5206e
Using the simple code below:

Code:
  move.l   #PROCESS_STACK_TOP,d0 //PROCESS_STACK_TOP points to ram
     //full read,write and execute permissions
  move.l   d0,SP
  move.l   #0x00002700,d0
  move     d0,SR
  jsr      test
  move.l   #0x00000700,d0
  move.w   d0,SR   //after the execution of the move.w
  move.l   #1,d0   //all instructions generate a privilege
  move.l   #1,d1   //violation
  add.l    d1,d0
  jsr      test
  trap     #15

test:
    rts
I'm not sure why this is happening, but the most likely awnser is that I'm forgeting something.
Can any one help me?

Thanks

Mário Isidoro
 


标签 (1)
0 项奖励
2 回复数

285 次查看
taigbr
Contributor I
Hi Mario,
maybe your ACR registers declare your program space to supervisor only
and since you changed SR to user every further access produces a
privilege violation.
Kind regards,
Georg

0 项奖励

285 次查看
NE555
Contributor I
I contacted Freescale technical support and they told me it was a problem with the bdm driver.
After recieving the reply, I tried putting the program in FLASH and running with no debug support, this made the problem go away.
This means it is not possible to use all the BDM capabilities to debug a program runing in user mode.

Mário Isidoro
0 项奖励