• Resolved

Compiler/TM4C129ENCPDT: Getting terminated

Expert 2255 points

Replies: 20

Views: 321

Part Number: TM4C129ENCPDT

Tool/software: TI C/C++ Compiler

Hi all,

my code is going into 


Error:E_usageFault: INVPC: Invalid PC

Error:E_memFault: IACCVIOL: Instruction Access Violation, address: e000ed34
FSR = 0x0004
HFSR = 0x40000000
DFSR = 0x00000000
MMAR = 0xe000ed34
BFAR = 0xe000ed38
AFSR = 0x00000000
Terminating execution...

during the execution time. Not all the time, only few times during debugging. I dont kow why it is going there? Any idea?

Thanks

  • Hello Akhilesh,

    Is this occurring with TivaWare or TI-RTOS?

    Our general fault debugging guide is: www.ti.com/.../spma043.pdf

    Best Regards,

    Ralph Jacobi

  • In reply to Ralph Jacobi:

    Hi Ralph,

    I am using ti rtos. 

    Thanks

  • In reply to Akhilesh Gangwar:

    Hi Akhilesh,

    Take a look at https://training.ti.com/debugging-common-application-issues-ti-rtos and https://e2e.ti.com/support/processors/f/791/t/854484.

    These will help you debug exceptions.

    Todd

  • In reply to ToddMullanix:

    Hi,

    I am getting this 

    0xFFFFFFFC (no symbols are defined). 

    Cant get much idea. 

  • In reply to Akhilesh Gangwar:

    Hi

    I am attaching the screenshot.  The lowe 8 bit of xPSR register is 3 which means processor exception occurs. (Seen from the datasheet of tm4c129encpdt).

    I am not able to trace it out what actually has happened. 

    Please let me know.

    Thanks 

  • In reply to Akhilesh Gangwar:

    Hi All,

    I am getting the exception at line no 161

    ======== ti_sysbios_family_arm_m3_Hwi_initStacks__E ========
    ; set up dual stacks
    ; only called if tasking is enabled
    ; otherwise, msp = the only stack.
    ; msp = handlers (isr Stack)
    ; psp = threads (task Stacks)
    ;
    ti_sysbios_family_arm_m3_Hwi_initStacks__E:
    .asmfunc
    push {lr}
    mrs r2, xpsr
    tst r2, #0xff ; check if we're in handler mode
    beq $1
    ;
    ; Here if CPU was not reset before starting the program
    ; and the last
    ; program halted while in handler mode.
    ; must unwind from handler mode before
    ; configuring control register
    ;
    mov r2, sp
    sub r2, #(8*4) ; make room for dummy stack frame
    msr psp, r2 ; update PSP
    mvn lr, #2
    str r0, [r2, #0] ; save passed R0 on ISR stack
    mov r1, #0x01000000 ; dummy xPSR with T bit set
    str r1, [r2, #28]
    ldr r1, $1Addr
    str r1, [r2, #24] ; return PC to $1 below
    bx lr ; "return" from ISR

    $1
    pop {lr}    ///////////////////////// line no 161
    mov r1, sp
    msr psp, r1 ; psp = task stacks
    msr msp, r0 ; msp = isrStack
    mov r0, #2
    mrs r1, control
    msr control, r0 ; split stacks now.

    .if __TI_VFP_SUPPORT__
    ldr r0, fpccr ; clear APSEN and LSPEN
    ldr r1, [r0] ; get current fpccr
    bic r1, r1, #0xc0000000 ; clear upper 2 bits
    str r1, [r0] ; save/restore manually
    .endif
    bx lr ; return on psp

    $1Addr
    .word $1

    .if __TI_VFP_SUPPORT__
    fpccr:
    .word 0xe000ef34
    .endif
    .endasmfunc
    .end

  • In reply to Akhilesh Gangwar:

    What does ROV->Hwi->Exception say? It looks like the application just started. All the Task stack peaks are the same, as if the tasks have not ran yet. Also why do you think it is in ti_sysbios_family_arm_m3_Hwi_initStacks__E? This function is called as part of BIOS_start.

    Todd

  • In reply to ToddMullanix:

    Hi Todd, 

    It says for INVLDPC. I don't know why it is there. I just followed the above-mentioned steps to trace out where the exception was coming and I found this. I have no idea. 

    AKhilesh

  • In reply to Akhilesh Gangwar:

    Can you show a picture of the ROV->Hwi->Exception view?

  • In reply to ToddMullanix:

    Hi Todd, 

    It says this

    Decoded exception,   

    Decoded,Hard Fault: FORCED: USAGE: INVPCBUSFAULT: IBUSERR

    Exception context,
    $addr,0x200342b4
    $type,ti.sysbios.family.arm.m3.Hwi.ExcContext
    threadType,ti.sysbios.BIOS.ThreadType_Task
    threadHandle,0x20000ee8
    threadStack,0x20000f38
    threadStackSize,768
    r0,0x20034418
    r1,0x0
    r2,0x0
    r3,0x0
    r4,0x20031d10
    r5,0x20
    r6,0x11
    r7,0x0
    r8,0xfffffff1
    r9,0xffffffff
    r10,0xffffffff
    r11,0xffffffff
    r12,0x0
    sp,0x2003438c
    lr,0x0
    pc,0x3cf4d
    psr,0x1000000
    ICSR,0x3
    MMFSR,0x0
    BFSR,0x1
    UFSR,0x4
    HFSR,0x40000000
    DFSR,0x0
    MMAR,0xe000ed34
    BFAR,0xe000ed38
    AFSR,0x0 


    Exception call stack,
    0 ti_sysbios_family_arm_m3_Hwi_initStacks__E() at Hwi_asm_switch.sv7M:161,PC = 0x0003CF4D FP = 0x2003438C