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

Initialization code overwrites fault handler vectors #16

Open
davide-b opened this issue Jan 31, 2022 · 1 comment
Open

Initialization code overwrites fault handler vectors #16

davide-b opened this issue Jan 31, 2022 · 1 comment

Comments

@davide-b
Copy link

In st_lld_teensy4.cpp the function setVectors() is defined, which overwrites the fault handler vectors to custom functions defined somewhere else. These functions merely blink the builtin LED with a code corresponding to the type of fault.

While this may be useful, it prevents the CrashReport class, introduced in TeensyDuino 1.54, from working properly and reporting faults. See https://www.pjrc.com/teensyduino-1-54-released/ at "Fault Recovery & CrashReport".

I think it would be useful to keep that functionality for boards that feature the iMXRT chip, like Teensy 4.0, 4.1 and MicroMod.
Right now I merely commented out these four lines in setVectors()

 _VectorsRam[3] = HardFault_Handler;
 _VectorsRam[4] = BusFault_Handler;
 _VectorsRam[5] = UsageFault_Handler;
 _VectorsRam[6] = MemManage_Handler;  

and that restored the CrashReport functionality.

I'll leave it up to you to decide whether this is something that you want to support in your codebase

@greiman
Copy link
Owner

greiman commented Jan 31, 2022

I will remove them or make them optional with the default disabled. They are useful for systems that don't catch bus faults.

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

No branches or pull requests

2 participants