OpenCores

* Amber ARM-compatible core

Issue List
bl error following mode change #1
Closed Botao opened this issue over 12 years ago
Botao commented over 12 years ago

Modified irq.S to test disabling irq. Program hangs on "bl disable_irq". lr does not have the right value. Please double check. ---Botao

#include "amber_registers.h"

.section .text
.globl  main

main:

    /* 0x00 Reset Interrupt vector address */
    b       start

    /* 0x04 Undefined Instruction Interrupt vector address */
    b       testfail

    /* 0x08 SWI Interrupt vector address */
    b       testfail

    /* 0x0c Prefetch abort Interrupt vector address */
    b       testfail

    /* 0x10 Data abort Interrupt vector address */
    b       testfail
    b       testfail

    /* 0x18 IRQ vector address */
    b       service_irq

    /* 0x1c FIRQ vector address */
    b       testfail

disable_irq: orr lr, lr, #0x08000000 mov pc, lr

start: / Set Supervisor Mode stack pointer / ldr sp, AdrSVCStack

    /* Switch to IRQ Mode */
    mov     r0, #0x00000002
    teqp    pc, r0
    /* Set IRQ Mode stack pointer */
    ldr     sp, AdrIRQStack

    /* Switch to User Mode */
    /* and unset interrupt mask bits */

    mov     r0,   #0x00000003
    teqp    pc, r0

    bl      disable_irq

(no changes below........) ldr r4, AdrRanNum ldr r5, r4 and r5, r5, #0x1c

csantifort was assigned over 12 years ago
csantifort commented over 12 years ago

I've recreated the bug and am working on a fix. Thanks for finding it.

Botao commented over 12 years ago

The following code doesnot work due to the same bug(I believe)

(in supervisor mode here) mov r0, #0x08000002 teqp pc, r0 // move to irq mode sub lr, lr, #4 // lr doesnot change at all !!

Hopefully this is helpful.

csantifort commented over 12 years ago

Fix for Amber23 and Amber25 cores submitted. Users should update to the latest version to avoid this bug.

csantifort closed this over 12 years ago

Assignee
csantifort
Labels
Request