An einer bestimmten Stelle meines Codes wird reproduzierbar ein HardFault geworfen, mit folgendem Stack:
1 | Debug proto.elf [Embedded C/C++ Application] |
2 | proto.elf |
3 | Thread #1 57005 (Suspended : Signal : SIGTRAP:Trace/breakpoint trap) |
4 | HAL_Delay() at stm32f7xx_hal.c:382 0x2005e8 |
5 | my_abort() at util.c:224 0x20fd2e |
6 | HardFault_Handler() at stm32f7xx_it.c:131 0x20f65a |
7 | <signal handler called>() at 0xfffffff1 |
8 | my_handler() at proto.c:501 0x0 |
9 | EXTI1_IRQHandler() at stm32f7xx_it.c:291 0xa16 |
10 | <signal handler called>() at 0xfffffff1 |
11 | follow_path() at ff.c:2,850 0x208658 |
12 | f_stat() at ff.c:4,356 0x20982c |
13 | my_function() at proto.c:2,080 0x20ce92 |
14 | my_scheduler() at proto.c:890 0x4ec |
15 | PendSV_Handler() at stm32f7xx_it.c:218 0xb76 |
16 | <signal handler called>() at 0xfffffff9 |
17 | main() at main.c:212 0x20e6b8 |
18 | /opt/atollic/ARMTools/bin/arm-atollic-eabi-gdb (7.10.1.20160923) |
19 | SEGGER J-LINK |
In my_function wird f_stat aufgerufen, während gerade ein IR mit höherer Priorität getriggert wird. Die my_handler Routine macht nur Arithmetik und GPIO und benutzt FatFs nicht. Ich verwende kein RTOS. Im HardFault-Handler sehe ich, dass
1 | SCB->HFSR = 0x40000000 -> "Forced" |
2 | SCB->CFSR = 0x80000 -> "Missing coprocessor" |
Was kann diesen Koprozessor-Fehler verursachen? Mein Code verwendet wissentlich keinen Koprozessor. Welcher Kopro ist denn überhaupt gemeint? Kann die Ursache bei FatFs (nicht reentrant) liegen?