Skip to content

Interrupts and Multiple Tasks Causing Usage Fault INVPC #63

Closed
@cversek

Description

@cversek

Hi, this problem has been plaguing me for a while now and it is very hard for me to pin down the root cause.
My board is an Adafruit STM32F405 Feather. The symptom is a Hard Fault/Usage Fault with INVPC bit set to 1 (found out using J-Link/Ozone debugger).

In my setup, I can cause the fault to happen with the following conditions: there is at least one external interrupt triggering at a rate > 200 Hz (not a hard bound but a typical rate), and there are at least two tasks running at the same time. The interrupt handler can be dead simple (just incrementing its own counter) with no interaction with the FreeRTOS API. The tasks don't need to interact directly and no other primitives are needed to cause instability. The interrupt is triggered by another chip pulling the line down - it has its own clock and its on a custom board. The fault usually occurs within a few minutes time, if the tasks are switching context faster, then the fault tends to happen sooner.

Strangely, I cannot reproduce this fault by using the microcontroller to drive its own interrupt pin directly - this seems pretty stable. Later I will try to drive the interrupt from another microcontroller to see if having independent clocks will cause the fault.

I'm pretty desperate to get this working, any advice would help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions