MCF5206 privilege violation

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MCF5206 privilege violation

1,086 Views
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
 


Labels (1)
0 Kudos
2 Replies

281 Views
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 Kudos

281 Views
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 Kudos