Skip to content

How to implement the Fault Escalation Mechanism #54

@asanza

Description

@asanza

Hi,

I was running a program inside the simulator, that triggers a HardFault inside the HardFault handler code. This caused the simulator to enter an infinite loop, where a HardFault continuously triggers another HardFault, and so on until it breaks.

From the ARMv6-M architecture manual:

The standard exception entry mechanism does not apply where a fault or Supervisor Call occurs at a priority of -1 or higher.

  • ARMv7-M requires the processor to handle most of these cases using a Lockup mechanism; otherwise, the condition becomes pending or is ignored.
  • ARMv6-M uses Lockup in all its supported cases. Lockup means the processor suspends normal instruction execution and enters a Lockup state.

It seems the simulator does not implement this Lockup behavior, the current behavior leads to the infinite loop described above.

Could you clarify how the fault escalation mechanism is intended to work in the simulator? Additionally, do you think the behavior should be adjusted to handle this scenario more gracefully? In my opinion, the simulator should just exit with error and dump of the internal registers of the simulated processor.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions