This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C1290NCZAD: Invalid EPSR and instruction combination

Part Number: TM4C1290NCZAD
Other Parts Discussed in Thread: SYSBIOS

Tool/software:

I'm working on a TI RTOS application with around 25 task and an average CPU load of < 20%. Recently I've discovered an issue where the application ends up in an exception as following:

ti.sysbios.family.arm.m3.Hwi: line 1095: E_hardFault: FORCED
ti.sysbios.family.arm.m3.Hwi: line 1207: E_usageFault: INVSTATE: Invalid EPSR and instruction combination
Exception occurred in ISR thread at PC = 0x2002afdc.
Core 0: Exception occurred in ThreadType_Hwi.
Hwi name: {unknown-instance-name}, handle: 0x20007058.
Hwi stack base: 0x20032098.
Hwi stack size: 0x800.
R0 = 0x00000022  R8  = 0x0008ce4c
R1 = 0x2002afdc  R9  = 0x0008baea
R2 = 0x40065000  R10 = 0x0008cfc0
R3 = 0x00059f3d  R11 = 0x0008cfb4
R4 = 0x200297f0  R12 = 0x17380300
R5 = 0x00000006  SP(R13) = 0x20032820
R6 = 0x00000001  LR(R14) = 0x00062fbb
R7 = 0x00000040  PC(R15) = 0x2002afdc
PSR = 0x80000062
ICSR = 0x00423003
MMFSR = 0x00
BFSR = 0x00
UFSR = 0x0002
HFSR = 0x40000000
DFSR = 0x00000001
MMAR = 0xe000ed34
BFAR = 0xe000ed38
AFSR = 0x00000000
.

I am able to reproduce the exception fairly reliably. The following points were identified:
- the error is related to accessing a mutex-protected resource,
- changing the timing behavior of tasks with sleep statements while the mutex is a trigger for raising the exception, but the time of occurrence is not determinable.

In principle, however, it is permitted for tasks to block indefinitely. Nevertheless, the exception occurs after some time and I cannot explain what the cause is. The address of the PC also raises questions.

Do you have any idea what causes such an exception?

TI SDK versions in use:

TI RTOS TIVAC 2.16.01.14
TI DRIVERS TIVAC 2.16.01.13
SYSBIOS 6.45.02.31
  • Hi,

    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    Hwi stack base: 0x20032098.
    Hwi stack size: 0x800.
    R0 = 0x00000022 R8 = 0x0008ce4c
    R1 = 0x2002afdc R9 = 0x0008baea
    R2 = 0x40065000 R10 = 0x0008cfc0
    R3 = 0x00059f3d R11 = 0x0008cfb4
    R4 = 0x200297f0 R12 = 0x17380300
    R5 = 0x00000006 SP(R13) = 0x20032820
    R6 = 0x00000001 LR(R14) = 0x00062fbb
    R7 = 0x00000040 PC(R15) = 0x2002afdc
    PSR = 0x80000062
    ICSR = 0x00423003
    MMFSR = 0x00
    BFSR = 0x00
    UFSR = 0x0002
    HFSR = 0x40000000
    DFSR = 0x00000001
    MMAR = 0xe000ed34
    BFAR = 0xe000ed38
    AFSR = 0x00000000

    You seem to have a usage fault that is elevated to a hard fault. The usage fault is somehow due to the processor attempting to execute an undefined instruction. 

    Usage Fault. A usage fault is an exception that occurs because of a fault related to instruction
    execution, such as:
    – An undefined instruction
    – An illegal unaligned access
    – Invalid state on instruction execution

    I will suggest you use the ROV to see if you have any memory problems and increase the system stack and heap to see if that makes a difference. Maybe you can first double the amount of both the system heap and stack. If the problem goes away, you can fine tune for the best amount for heap and stack allocation. See below where you can allocate the runtime heap and stack in the .cfg file. 

    Please also refer to the below two posts on how to debug exceptions for TI-RTOS app.