This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Spurious SWI call (SWI_Dead lock)

Hello,

I am experiencing what seems to be a spurious SWI call.
The effect is that the application hangs on the SWI Handler
__asm void SWI_Handler (void):

SWI_Dead BHS SWI_Dead

What can I do to identify the origin of this spurious call?

The ARM processor is the LPC2387. I am using Keil RTOS and compiler version:

IDE-Version:
µVision3 V3.80
Copyright (c) Keil Elektronik GmbH / Keil Software, Inc. 1995 - 2009

Tool Version Numbers:
Toolchain: RealView MDK-ARM Version: 3.50
Middleware: RL-ARM Real-Time Library Version V3.50
Toolchain Path: BIN40\
C Compiler: Armcc.Exe V4.0.0.524
Assembler: Armasm.Exe V4.0.0.524
Linker/Locator: ArmLink.Exe V4.0.0.524
Librarian: ArmAr.Exe V4.0.0.524
Hex Converter: FromElf.Exe V4.0.0.524
CPU DLL: SARM.DLL V3.50
Dialog DLL: DARMP.DLL V1.44
Target DLL: BIN\UL2ARM.DLL V1.47
Dialog DLL: TARMP.DLL V1.44

Regards,
Andre

Parents Reply Children
  • The situation is as follows:
    The software runs communicating through a CAN interface.
    After approximately 5 minutes it hangs up in a SWI_Dead loop.
    Analysing the call stack, the SWI call occurred from inside a function called from an interrupt routine, in the sequence below (CAN_Handler is the interrupt routine)
    CAN_Handler() -> CAN_RX2_ISR() -> CAN_hw_rd() -> SWI??

    The problem is there is no explicit call to SWI from inside CAN_hw_rd().

    // detail from CAN_hw_rd() :

    0x00032100  E2402001  SUB       R2,R0,#0x00000001
       378:   regCAN *ptrcan = (regCAN *) CAN_BASE[ctrl0];
       379:
    0x00032104  E59F4780  LDR       R4,[PC,#0x0780]
    0x00032108  E794E102  LDR       R14,[R4,R2,LSL #2]
       381:   CANData = ptrcan->CANRFS;
    0x0003210C  E59E3020  LDR       R3,[R14,#0x0020]
       382:   msg->format   = (CANData & 0x80000000) == 0x80000000;
    0x00032110  E1A04FA3  MOV       R4,R3,LSR #31
    0x00032114  E5C1400E  STRB      R4,[R1,#0x000E]
       383:   msg->type     = (CANData & 0x40000000) == 0x40000000;
    0x00032118  E2034101  AND       R4,R3,#0x40000000             << spurious SWI call
    0x0003211C  E1A04F24  MOV       R4,R4,LSR #30
    0x00032120  E5C1400F  STRB      R4,[R1,#0x000F]
       384:   msg->len      = ((U8)(CANData >> 16)) & 0x0F;
       385:
    0x00032124  E3A0400F  MOV       R4,#0x0000000F
    0x00032128  E0044823  AND       R4,R4,R3,LSR #16
    0x0003212C  E5C1400C  STRB      R4,[R1,#0x000C]
       387:   msg->id = ptrcan->CANRID;
       388:
    0x00032130  E59E4024  LDR       R4,[R14,#0x0024]
    0x00032134  E5814000  STR       R4,[R1]
       390:   if (msg->type == DATA_FRAME)
    
    

    Thanks a lot,