S12Z access violation error

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

S12Z access violation error

Jump to solution
389 Views
sergemonnerat
Contributor III

Hi,

I use the devkit s12zvc and I get an access violation error when I execute any assembly instruction inside the RTI interrupt. Any first assembly instruction cause an access violation error. The MMCEC register after the error:

MMCEC = 1441

Error code register

Bit Field Values:
ITR bits[ 15:12 ] = 1 S12ZCPU
TGT bits[ 11:8 ] = 4 Program Flash
ACC bits[ 7:4 ] = 4 Data store
ERR bits[ 3:0 ] = 1 Access to an ilegal address range

An idea ?

Best regards

here is my assembly code:

;------------------------------------------------------------
;Copyright 2003-20xx Haute école ARC Ingéniérie, Switzerland.
;All rights reserved.
;------------------------------------------------------------
;Nom du fichier : main.asm

;But : Laboratoire 8.3 (while...)

;Version:
; - OGL/14.09.21 création
;
;------------------------------------------------------------

;--------------------------------------------------------------
; Exportation des symboles
;--------------------------------------------------------------
XDEF Entry,_Startup,RTI_Interrupt
;XREF RTI_Interrupt
INCLUDE 'mc9s12zvl32.inc'

;--------------------------------------------------------------
; Déclaration des constantes d'assemblage (équivalences)
;--------------------------------------------------------------


;--------------------------------------------------------------
; Section pour les variables et les données --> zone de RAM
;--------------------------------------------------------------
DEFAULT_RAM: SECTION


;--------------------------------------------------------------
; Section pour le code et les constante --> zone de ROM
;--------------------------------------------------------------
DEFAULT_ROM: SECTION
; 0 1 2 3 4 5 6 7 8 9 10 11
STATELED: DC.B $04,$0C,$1C,$3C,$7C,$FC,$7C,$3C,$1C,$0C,$04,$00

; Début du programme (ces 2 labels sont utilisés par CodeWarrior)
_Startup:
Entry:

; Clear du flag RTIF
ld d0,CPMUIFLG
or.b d0,#$80;
st.b d0,CPMUIFLG

mov.b #$10,CPMURTI

; Enable RTIE
ld d0,CPMUINT
or.b d0,#$80;
st.b d0,CPMUINT

MOV.B #$FC, DDRT ; configuration en sortie
;Enable des interruptions au niveau de la CPU
cli


; Boucle sans fin
loop:
; Votre code ici...
nop
BRA loop ; Recommence au début de la boucle infinie

 

RTI_Interrupt:

; Clear du flag RTIF
ld d0,CPMUIFLG
or.b d0,#$80;
st.b d0,CPMUIFLG

ld d0,PTT
eor d0,#$04
st d0,PTT

rti

0 Kudos
1 Solution
375 Views
sergemonnerat
Contributor III
Finally the error (very stupid) was that I had not configured the SP ... Thanks !

View solution in original post

0 Kudos
2 Replies
376 Views
sergemonnerat
Contributor III
Finally the error (very stupid) was that I had not configured the SP ... Thanks !
0 Kudos
376 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @sergemonnerat,

Do other interrupts work?

Why do you include an S12ZVL header file to an S12ZVC project?

 

Regards,

Daniel

0 Kudos