Hi,
I am using the TMS570 Microcontroller Development Stick, with a TMS570LS20216 MCU (ASPGEQQ1).
I can not get the IRQ interrupts working in user mode.
If I manually reset the CPSR register I bit to "0" the interrupts work ok, but I can not do this for the real code.
I have experimented with trying the code snippet in the technical reference manual (section 24.7.1 example 2), but I get the errors "[E003] Unexpected trailing operands" and "[E004] Illegal operand".
Referring to section 24.7.1 example 2: I am not sure how to preserve register R1. It is unclear where I should put the "SWI" instruction. I guess this shoud be in the main program as "asm("swi");? But I am not sure then where the "software interrupt service routine" would be?
The asm file I am using is irq_fiq_en.asm as below.
Regards,
Dave
;-------------------------------------------------------------------------------
; irq_fiq.asm
;
;
.text
.arm
; FIQENABLE .equ 0x40
; IRQENABLE .equ 0x80
;-------------------------------------------------------------------------------
; FIQ Enable
.global _Enable_Fiq
.asmfunc
_Enable_Fiq
MRS R1, CPSR
BIC R1, R1, 0x40
MSR CPSR_cf, R1
MOV PC, LR
.endasmfunc
;-------------------------------------------------------------------------------
; IRQ Disable
.global _Disable_Irq
.asmfunc
_Disable_Irq
MRS R1, CPSR
ORR R1, R1, 0x80
MSR CPSR_cf, R1
MOV PC, LR
.endasmfunc
;-------------------------------------------------------------------------------
; IRQ Enable
.global _Enable_Irq
.asmfunc
_Enable_Irq
MRS R1, CPSR
BIC R1, R1, 0x80
MSR CPSR_cf, R1
MOV PC, LR
.endasmfunc
;-------------------------------------------------------------------------------