One of the things that I hate to do is to modify a library-type of code. That creates an upgrade nightmare: Either future patches no longer apply or I start over and end up with the library without the patches if I simply install the new version. Read "chibios" for library in this paragraph.
So I want to override the chibios _unhandled_exception function to help me in debugging my application. That can be achieved by declaring the function "weak" in vectors.c, so that I can add an _unhandled_exception function of my own desire to my main source.
So now it becomes possible to easily implement Franks suggestion: https://blog.frankvh.com/2011/12/07/cor ... t-handler/
My request is to add this to chibios.
I also found a definition for _unhandled_exception in vectors.S but that seems to be unused. Maybe clean it up?
Code: Select all
diff --git a/os/common/startup/ARMCMx/compilers/GCC/vectors.c b/os/common/startup/ARMCMx/compilers/GCC/vectors.c
index e7b0fe30e..713a11c09 100644
--- a/os/common/startup/ARMCMx/compilers/GCC/vectors.c
+++ b/os/common/startup/ARMCMx/compilers/GCC/vectors.c
@@ -43,7 +43,7 @@
* @notapi
*/
/*lint -save -e9075 [8.4] All symbols are invoked from asm context.*/
-void _unhandled_exception(void) {
+void __attribute__((weak)) _unhandled_exception(void) {^M
/*lint -restore*/
while (true) {