Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom panic handler #16

Merged
merged 1 commit into from
Jun 21, 2022
Merged

Add custom panic handler #16

merged 1 commit into from
Jun 21, 2022

Conversation

renzenicolai
Copy link
Member

@renzenicolai renzenicolai commented Jun 17, 2022

(ESP32 side not done yet so I still have to test if it works properly)

The idea here is that if a call to panic() is made the RP2040 will reboot and set a register accessible over I2C that indicates it has crashed.

SDK behaviour of panic() is to print ***** PANIC ***** with a reason to the UART then halt, that's not very usefull on the badge.

When the RP2040 crashes and reboots it resets the ESP32 too, so checking the register on startup and showing a message to the user indicating the reason for rebooting would help identify RP2040 problems on production firmware.

When compiled in debug mode the panic handler isn't modified so that crashes can be investigated with a JTAG debugger.

@renzenicolai renzenicolai merged commit e9f44ba into master Jun 21, 2022
@renzenicolai renzenicolai deleted the panic_handler branch June 28, 2022 13:39
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.

1 participant