Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

bradjc
Copy link
Contributor

@bradjc bradjc commented Mar 5, 2024

Pull Request Overview

This pull request changes how the stack addresses are created to print during kernel hardfaults. I noticed when I was getting kernel hardfaults like:

panicked at arch/cortex-v7m/src/lib.rs:347:9:
Kernel HardFault.
	Kernel version release-2.1-2639-ga67a57c99
	r0  0xffff00ff
	r1  0x2000866c
	r2  0x6
	r3  0x6
	r12 0x20001d50
	lr  0x20008634
	pc  0x19942
	prs 0x61000000 [ N 0 Z 1 C 1 V 0 Q 0 GE 0000 ; ICI.IT 0 T true ; Exc 0-Thread Mode ]
	sp  0x20001718
	top of stack     0x10000000
	bottom of stack  0x2a4b29ca
	SHCSR 0x0
	CFSR  0x8200
	HSFR  0x40000000
	Instruction Access Violation:       false

Now it is correct:


panicked at arch/cortex-v7m/src/lib.rs:347:9:
Kernel HardFault.
	Kernel version release-2.1-2639-ga67a57c99
	r0  0xffff00ff
	r1  0x2000866c
	r2  0x6
	r3  0x6
	r12 0x20001d50
	lr  0x20008634
	pc  0x19942
	prs 0x61000000 [ N 0 Z 1 C 1 V 0 Q 0 GE 0000 ; ICI.IT 0 T true ; Exc 0-Thread Mode ]
	sp  0x20001718
	top of stack     0x20002000
	bottom of stack  0x20000000
	SHCSR 0x0
	CFSR  0x8200
	HSFR  0x40000000
	Instruction Access Violation:       false
	Data Access Violation:              false
	Memory Management Unstacking Fault: false

I also removed some old externs we don't use.

Testing Strategy

This pull request was tested by faulting on the nrf52840dk.

TODO or Help Wanted

Is this the best fix?

Documentation Updated

  • Updated the relevant files in /docs, or no updates are required.

Formatting

  • Ran make prepush.

Copy link
Member

@lschuermann lschuermann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha, good catch! This presumably also issued a read to those addresses, which is not great.

@brghena brghena added this pull request to the merge queue Mar 6, 2024
Merged via the queue into master with commit 01918fa Mar 6, 2024
@brghena brghena deleted the cortex-hardfault-stack branch March 6, 2024 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants